android-about-page
android-about-page copied to clipboard
Email Intent Problem
.addEmail("[email protected]")
I added a email like this. When user clicks that, then other messasing applications are also showed. If the user choose Whatapp, then this button never work. I just want only email apps are asked to user.
So can you please change the code?
BEFORE:
public AboutPage addEmail(String email, String title) {
Element emailElement = new Element();
emailElement.setTitle(title);
emailElement.setIconDrawable(R.drawable.about_icon_email);
emailElement.setIconTint(R.color.about_item_icon_color);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("message/rfc822");
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
emailElement.setIntent(intent);
addItem(emailElement);
return this;
}
AFTER:
public AboutPage addEmail(String email, String title) {
Element emailElement = new Element();
emailElement.setTitle(title);
emailElement.setIconDrawable(R.drawable.about_icon_email);
emailElement.setIconTint(R.color.about_item_icon_color);
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:"));
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
emailElement.setIntent(intent);
addItem(emailElement);
return this;
}
Thank you @ahmetturk, could you make a pull request so I can merge it ?
Okay, I am going to make it
It was added in PR 106, so this issue could be closed.