Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClickEvent for SubItems #30

Open
SamFreaks opened this issue Feb 11, 2019 · 0 comments
Open

ClickEvent for SubItems #30

SamFreaks opened this issue Feb 11, 2019 · 0 comments

Comments

@SamFreaks
Copy link

SamFreaks commented Feb 11, 2019

Hey,its not an Bug or an Issue,

I implement this in my Project and i try to use it with 3 Subbottons (Email, Homepage, Telegram-Group) and i use

val fab = findViewById(R.id.fab) fab.addOnMenuItemClickListener { _, _, _ -> val to = "xxx" val 
subject 
= "xxx" val message = "xxxx"```
val email = Intent(Intent.ACTION_SEND)
email.putExtra(Intent.EXTRA_EMAIL, arrayOf(to))
email.putExtra(Intent.EXTRA_SUBJECT, subject)
email.putExtra(Intent.EXTRA_TEXT, message)
email.type = "text/email"
startActivity(Intent.createChooser(email, "Choose an Email client :")) }
}

it works on every subbutton click, but if i type in fab_email ( thats the id in my menu->fab.xml)

android:id="@+id/fab_email" 
android:title="Email" 
android:icon="@android:drawable/ic_dialog_email" 
android:orderInCategory="1"/>

my app crash

val fab = findViewById(R.id.fab_email) fab.addOnMenuItemClickListener { _, _, _ -> val to = "xxx" val 
subject = "xxx" val message = "xxxx"```
val email = Intent(Intent.ACTION_SEND)
email.putExtra(Intent.EXTRA_EMAIL, arrayOf(to))     
email.putExtra(Intent.EXTRA_SUBJECT, subject)
email.putExtra(Intent.EXTRA_TEXT, message)
email.type = "text/email"
startActivity(Intent.createChooser(email, "Choose an Email client :")) }
}

hope you can help me and sry for my bad english

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant