How to get the current screen after sending a mail from the app in Android
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 !
精彩评论