tags:

views:

49

answers:

2

Hello all,

Hope you will understand my question with my basic english...

In my application, I allow the user to have a button that launch the application of his choice. I get no problem to make a list of all installed apps, get the Intent and launch the choosen app.

But I would like to save the corresponding intent in the settings for the next time the user use my application, but settings only allow me to save basic data type ( Integer, boolean, Strings, etc. )

So, my question is how to save an intent in a smart way.

I hope you can help me to find a solution.

+1  A: 

Instead of saving the Intent you could just save the String which is necessary to build the Intent.

Example:

Intent intent = new Intent("com.android.notepad.action.EDIT_TITLE");

Now you just store a String containing "com.android.notepad.action.EDIT_TITLE"

Roflcoptr
A: 

Thank for your answer. My Intent is build following a tutorial with these lines: Intent intent = new Intent(); intent.setComponent(new ComponentName(info.activityInfo.applicationInfo.packageName, info.activityInfo.name)); So I guess, I have to save 2 Strings each time I need an intent?

Profete162
yes i think that should work
Roflcoptr