Android application chrashes after "share" intent
- by Johe Green
Hi,
My app offers a "share/tell-a-friend" function. When the "share" button is pressed the following method is being called to open a list of apps, which can perform the action (Eg. Gmail, Twittroid, Facebook...):
public void share() {
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getText(R.string.menu_share_subject));
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, getText(R.string.menu_share_body));
startActivity(Intent.createChooser(shareIntent, getText(R.string.menu_share_intent)));
}
The sharing functionality works basically. But when the sharing app (Facebook, Twitter, ...) tries to return to my app, a force close is thrown.
I guess that my app gets closed in the background during the sharing process... at least that is what the debugger sais...
Any ideas?