开发者

launching email client from my app(android)

开发者 https://www.devze.com 2023-01-26 01:08 出处:网络
hi i have used the following code to launch an email client but it is launching only messaging app...so what should get modified in this code....

hi i have used the following code to launch an email client but it is launching only messaging app...so what should get modified in this code....

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emai开发者_运维问答lIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {"vgsl.manju@gmail.com"});
emailIntent.setType("text/plain");
startActivity(Intent.createChooser(emailIntent, "Send a mail ..."));


Code snippet looks fine. Try it on an actual device, it should work fine.


    Intent intent = getPackageManager().getLaunchIntentForPackage("com.android.email");
    startActivity(intent);

Try this, it works on me.


first check if your email client is configured.

0

精彩评论

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