android-about-page icon indicating copy to clipboard operation
android-about-page copied to clipboard

Email Intent Problem

Open ahmetturk opened this issue 6 years ago • 3 comments

.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;
    }

ahmetturk avatar Mar 15 '18 19:03 ahmetturk

Thank you @ahmetturk, could you make a pull request so I can merge it ?

medyo avatar Mar 15 '18 21:03 medyo

Okay, I am going to make it

ahmetturk avatar Mar 15 '18 21:03 ahmetturk

It was added in PR 106, so this issue could be closed.

cyb3rko avatar Jun 28 '20 15:06 cyb3rko