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

Email Intent Problem #105

Closed
ahmetturk opened this issue Mar 15, 2018 · 3 comments
Closed

Email Intent Problem #105

ahmetturk opened this issue Mar 15, 2018 · 3 comments

Comments

@ahmetturk
Copy link
Contributor

.addEmail("elmehdi.sakout@gmail.com")
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;
    }
@medyo
Copy link
Owner

medyo commented Mar 15, 2018

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

@ahmetturk
Copy link
Contributor Author

Okay, I am going to make it

@cyb3rko
Copy link
Contributor

cyb3rko commented Jun 28, 2020

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

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

3 participants