android hasExtra的用法

来源:互联网 发布:2016年7月非农数据 编辑:程序博客网 时间:2024/06/01 15:04

public boolean hasExtra (String name)

Added in API level 1

Returns true if an extra value is associated with the given name.

Parameters
namethe 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值
文档解释

0 0
原创粉丝点击