我有一个指向 gmail 的链接。当我单击链接时,意图打开两个或多个带有 gmail 的窗口。我认为这可能是主要问题“Intent.ACTION_SEND”。
提前致谢。
// TextView button for Email address
emailLink.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
//email address
String emailAddress = "some_email@gmail.com";
String subject = "Write a topic";
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{emailAddress});
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.setType("text/plain");
startActivity(intent);
return true;
}
});