Messaging and email intents in Android?

后端 未结 2 1663
闹比i
闹比i 2021-01-23 13:01

I\'ve searched Google for this, but have only found similar examples--not exactly what I need. I simply need to start messaging (SMS) and email intents from my app with their \"

2条回答
  •  醉梦人生
    2021-01-23 13:18

    from Only Email apps to resolve an Intent

       String recepientEmail = ""; // either set to destination email or leave empty
       Intent intent = new Intent(Intent.ACTION_SENDTO);
       intent.setData(Uri.parse("mailto:" + recepientEmail));
       startActivity(intent);
    

    will filter out all non-email applications.

提交回复
热议问题