开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜