Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android-电子邮件发送错误_Android_Email - Fatal编程技术网

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);