问题
I'm running into a weird issue in my app development.
At some point in my app, it would call an Intent (Intent.ACTION_SEND) to launch Gmail, and the "Complete action using..." dialog will appear.
Even though I check the default box at the bottom and select Gmail, the next time my app calls for the Intent, the Complete action using dialog keeps appearing.
I can not get it to go away even though I already selected the default app to launch.
Any ideas why?
Example of the Intent
private void do_gmail_failover() { // If GMailSender fails, revert back to old method
Intent email_pic = new Intent(Intent.ACTION_SEND); // Commence choose photo action // Used to be ACTION_SEND
email_pic.putExtra(Intent.EXTRA_EMAIL, Recipients); // Inserts Digital Signature address in recipient
email_pic.putExtra(Intent.EXTRA_SUBJECT, DIGIJOB); // Inserts Track Number automatically in subject
email_pic.putExtra(Intent.EXTRA_STREAM, uriTarget); // Attaches image to Gmail
email_pic.setType("image/jpeg"); // Converts image to jpeg
startActivityForResult(email_pic, RETURN_ACTIVITY);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
LOGCAT.DEBUG("do_gmail_failover", "Inside do_gmail_failover function");
}
来源:https://stackoverflow.com/questions/22238315/android-complete-action-using-keeps-showing-after-default-has-been-selected