开发者

How to get the current screen after sending a mail from the app in Android

开发者 https://www.devze.com 2023-02-03 13:19 出处:网络
final Intent intent = new Intent(Intent.ACTION_SEND); intent.setType(\"text/plain\"); intent.putExtra(Intent.EXTRA_SUBJECT, \"From my site\");
final Intent intent = new Intent(Intent.ACTION_SEND);
   intent.setType("text/plain");

   intent.putExtra(Intent.EXTRA_SUBJECT, "From my site");

   intent.putExtra(Intent.EXTRA_TEXT, card.text + "\n\n"
     + "Sent from my si开发者_开发百科te " + " "
     + "http://www.mysite.com");
   startActivity(intent);

I did this in my application, and after sending the email my application exits, but I don't want it to. After sending the email I want it to return to the screen from my app. Can anyone help me with this?


Ideally it should not exit. In fact I tried out your code on my machine and it came back to the activity fine.

I think your application may be crashing somewhere just after this particular piece of code. Try debugging it, or maybe check your logcat for possible exceptions !

0

精彩评论

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