注意:如果intent取的类型不对则很可能取出的数值为0或者null
Bundle bundle = intent.getExtras();
for (String key: bundle.keySet())
{
Log.i("Bundle Content", "Key=" + key + ", content=" +bundle.getString(key));
}
本文探讨了在移动应用开发中如何通过Intent获取Bundle数据,并展示了如何遍历Bundle中的键值对进行日志记录。这对于理解Android应用内部的数据传递机制至关重要。
注意:如果intent取的类型不对则很可能取出的数值为0或者null
Bundle bundle = intent.getExtras();
for (String key: bundle.keySet())
{
Log.i("Bundle Content", "Key=" + key + ", content=" +bundle.getString(key));
}
2931
256

被折叠的 条评论
为什么被折叠?
