开发者

Android - Email Send Error

开发者 https://www.devze.com 2023-02-19 13:57 出处:网络
I am attempting to have a button that when clicked opens up an email window where email can be sent. I am receiving the following error:

I am attempting to have a button that when clicked opens up an email window where email can be sent. I am receiving the following error:

Unsupported action - that action is currently not supported

Here is the my code.

        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 Em开发者_JAVA百科ail")); 
            }
            return true;
        }
    });


Change

   _this.startActivity(Intent.createChooser(displayIntent, "Send Email")); 

to

  _this.startActivity(displayIntent); 
0

精彩评论

暂无评论...
验证码 换一张
取 消