Search code examples
androidandroid-intentdata-retrieval

How to get value from mMap in intent?


enter image description here

I have attached image.Please tell, how to retrieve values from mMap ?


Solution

  • Access fields with in Object. I want to access "displayValue".

    Object o = data.getExtras().get("Barcode");
    Field f = o.getClass().getDeclaredField("displayValue");
    f.setAccessible(true);
    String value = (String) f.get(o);
    

    One way to access the field with in Object.