What is ActivityInfo meta data?
What is ActivityInfo's meta data?
Bundle bundle开发者_JAVA技巧 = actInfo.metaData;
What kind of data bundle contains and how to retrieve data from Bundle if no key pair known?
Thanks
It's whatever meta data was specified in the Activity's manifest.
<activity>
<meta-data android:name="key" android:value="value" />
<meta-data android:name="key2" android:resource="@string/res" />
</activity>
http://developer.android.com/guide/topics/manifest/meta-data-element.html
Bundle has a method called keySet which returns Set<String>
. With that, you can iterate through all the data with Bundle.getString, getInt, getBoolean, getFloat. I don't think there is a way to know the correct/intended data type though.
精彩评论