public boolean hasExtra (String name)
Added in
API level 1
Returns true if an extra value is associated with the given name.
Parameters
name | the extra's name |
---|
Returns
- true if the given extra is present.
Intent intent = getIntent();
Log.i("TAG1", intent.hasExtra("x") + "");
Log.i("TAG1", intent.hasExtra("y") + "");
Log.i("TAG1", intent.hasExtra("z") + "");
个人理解是判断intent传值过来是否包含上一个页面的key值
文档解释