我尝试了以下代码,但仍然没有找到列出捆绑中所有包含的密钥的方法。
JavaCode:
private void unpackBundle() {
// TODO Auto-generated method stub
Set <String> mBundleKeysSet = this.mBundle.keySet();
int size = mBundleKeysSet.size();
Toast.makeText(getApplicationContext(), size+" keys",Toast.LENGTH_LONG).show();
if ( mBundleKeysSet.iterator().hasNext() ) {
//here i should display a list of the contained keys
//in the bundle
}
}
答案 0 :(得分:0)
实际上,我找到了答案:
private void unpackBundle() {
// TODO Auto-generated method stub
Set <String> mBundleKeysSet = this.mBundle.keySet();
int size = mBundleKeysSet.size();
Toast.makeText(getApplicationContext(), size+" keys",Toast.LENGTH_LONG).show();
toast.makeText(getApplicationContext(), mBundleKeysSet.toString()
,Toast.LENGTH_LONG).show();
}