0

I have an Android app which allows the user to send me an e-mail for support, it works fine on all normal Android devices but Amazon AppStore recently rejected my App because it exits the app when the user tries to send an e-mail. I don't know how to fix it, here is my e-mail code that I've been using for all of my Android apps:

button.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {
        Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
        String[] recipients = new String[] { "test@email.com };
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "title");
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "message");
        emailIntent.setType("text/html");
        startActivity(Intent.createChooser(emailIntent, "Send ..."));
        finish();
    }
});
Alan Moore
  • 6,525
  • 6
  • 55
  • 68

1 Answers1

1

I just tried this on a Kindle HDX.

Perhaps your app crashed on:

String[] recipients = new String[] { "test@email.com };

You need to add another " after .com

And perhaps you want to use

button.setOnClickListener(new View.OnClickListener() {
Al Wang
  • 354
  • 2
  • 10
  • I actually did get this to work, I don't know why it didn't work to begin with but I suspect some sort of build artifact caused the problem. Cleaning and rebuilding seemed to fix it. – Alan Moore Feb 18 '15 at 03:54