Q: intent to uri and then back to intent sometimes fails In my app I get intents to launch apps (the user can choose one of the installed apps) and I convert them to URI to store in a database. Then I convert them back to an Intent to launch the app.
But of all the apps I have tried to launch, in two it doesn't work: Gallery (says "couldn't find item) and People (a gray activity with nothing on it appears).
This is the code I have:
intent.toUri(Intent.URI_INTENT_SCHEME);
Intent inte = Intent.parseUri(getIntentUri(), Intent.URI_INTENT_SCHEME);

These are the intents converted to strings:
Before converting to URI:
{ cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.google.android.gallery3d/com.android.gallery3d.app.GalleryActivity }
{ cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.contacts/.activities.PeopleActivity }

After converting to URI and back:
{ act=android.intent.action.VIEW cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.google.android.gallery3d/com.android.gallery3d.app.GalleryActivity }
{ act=android.intent.action.VIEW cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.contacts/.activities.PeopleActivity }

As the difference between them is the added VIEW action, I imagine I only need to remove that. What I don't know is how can I do it.

A: I solved it, and it was so simple. I don't know how didn't I think of this:
inte.setAction("");

