Android-电子邮件发送错误
我试图有一个按钮,当点击打开一个电子邮件窗口,电子邮件可以发送。我收到以下错误: 不支持的操作-当前不支持该操作 这是我的密码Android-电子邮件发送错误,android,email,Android,Email,我试图有一个按钮,当点击打开一个电子邮件窗口,电子邮件可以发送。我收到以下错误: 不支持的操作-当前不支持该操作 这是我的密码 public boolean onTouch(View v, MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_DOWN) { Intent displayIntent = new Intent(
public boolean onTouch(View v, MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_DOWN)
{
Intent displayIntent = new Intent(android.content.Intent.ACTION_SEND);
displayIntent.setType("text/plain");
displayIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"to@email.com"});
displayIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
displayIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
_this.startActivity(Intent.createChooser(displayIntent, "Send Email"));
}
return true;
}
});
改变
到
改变
到
_this.startActivity(Intent.createChooser(displayIntent, "Send Email"));
_this.startActivity(displayIntent);