Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enumerate key value pairs of a bundle

Does anyone know of a way to enumerate all of the key value pairs of a bundle without knowing ahead of time all the keys?

like image 642
Roy Hinkley Avatar asked Aug 29 '13 13:08

Roy Hinkley


1 Answers

I think the only way to get all they key-value pairs is to enumerate through keys using keySet() and then get() its relative value. For example:

for(String key : bundle.keySet()){
    Object obj = bundle.get(key);   //later parse it as per your required type
}
like image 158
waqaslam Avatar answered Sep 20 '22 03:09

waqaslam