一些时候,我们需要查询外调传入的参数是否合法。
可以直接在log中输出所有的 intent 参数,便于排查
try {
Bundle bundle = i.getExtras();
for (String key: bundle.keySet()){
Log.e("Bundle Content", "Key=" + key + ", content=" + bundle.getString(key));
}
}catch (Exception e){
e.printStackTrace();
}