While sending requests via Facebook_Android SDK, I get a bundle in return. Can someone explain what data type it is and how to extract the data in it? Thanks.
01-28 11:58:07.548: I/Values(16661): Bundle[{to[0]=100005099741441, to[1]=100005089509891, request=134129756751737}]
EDIT
Here, to[i] is a string array. I was able to do it. but I don’t think its the right way to do it.
for(int i=0;i< size-1;i++){
System.out.println(values.getString("to["+i+"]"));
}
where size is the size of the Bundle called value
A
Bundleis basically a dictionary. Each value in the Bundle is stored under akey. You must know the type of value under the key. When you know the type, you access the value associated with thekeyby calling a method relevant for the type of the value (again, you must know the type).For example if the
keyisrequestand its type isStringyou would call:If the type was
long, you would call:To loop over the
toarray provided that the value is of typeStringyou can do this:which does not rely on the size of the bundle object.
All the keys in a bundle and the type of value for each key should be provided in the Facebook API for Android. If you need further information on the
Bundleobject please look at the reference here.