Search code examples
androidandroid-intentbundle

How to extract values from a bundle in android?


How can I extract the values "Stock", "Currency" and "Euro" from this bundle ?

This is my output for bundle.toString() :

Bundle[{Stock:Currency=Bundle[{_=Euro}]}]

Solution

  • The toString() output is a bit ambiguous, but this might work:

    Bundle subBundle = bundle.getBundle("Stock:Currency");
    String euro = subBundle.getString("_");
    

    If this works, then euro will contain the string Euro.