Q:

Android: Bundle.toString() and then create a Bundle from String

I'm trying to do the following:
// I have a Bundle and convert it to string
Bundle _bundle;
// Meanwhile I put intergers, booleans etc in _bundle
String _strBundle = _bundle.toString();

Later in my code I need to create a Bundle from _strBundle. How do I do that? So far I couldn't find any information on this. Of course I don't wish to parse _strBundle myself and hope that the fremawork already provides a String2Bundle sort of a functionality.

A:

As far as i know there is no way for the framework to know what is stored in your string. The same pattern could have possible interpretations (string, boolean, integer) and so i don't think that that actually even makes sense. 
In fact i can't imagine why you would need to do it. You already have the bundle in the first place. I suggest you keep the original bundle and use it when you need it or make the parse of the string and create the bundle yourself (which won't be an easy task if you want to cover all the possibilities).

A:

If you want to pass data as String to another place, it's better to use JSONObject it's very simple to create JSONObject from String and vice versa. And it's too similar to Bundle class!
json = new JSONObject(str);
str = json.toString();

Also, You can pass it as String parameter with Intent or the other method as String.

