I'm implementing an option for sharing content from my app. When the user presses the share button the following code is executed.
public static void openShareIntent(Context context, String text, Wish wish)
{
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
share.putExtra(Intent.EXTRA_TEXT, text);
share.putExtra("share_wish", wish);
startIntent(context, share);
}
I'm setting one special extra for my Intent, that is object wish
witch implements the Parcelable
interface.
This object contains some extra information. I want to use this information if the user selects my app (current app actually sharing content) from the available apps for sharing text/plain
.
But the problem is that all other popular apps (Facebook, Twitter, ...) and built-in apps (Messaging) crash when I include my Parcable
object. It's not my applications that crashes, other apps are throwing quit unexpectedly
error.
When I call my SharingActivity
with some extra name that is not known to this Activity, it does not crash. It just ignore that extra.
Am I doing something wrong or what?
Is this not possible because other apps don't know my Wish
object?