Bry*_*n P -3 android android-intent
如果我getIntent().getExtras().getBoolean("key")不使用该.putExtra("key",boolean)方法,那么价值是多少?
它不接受,!= null因为它是布尔所以任何要点?
我的解决方案
boolean defaultValue = false;
boolean yourValue = getIntent().getBooleanExtra(YOUR_EXTRA, defaultValue);
Run Code Online (Sandbox Code Playgroud)
如果您没有生成putExtra,您的意图将具有您已确定的默认值.
我希望我帮助过你!
| 归档时间: |
|
| 查看次数: |
3960 次 |
| 最近记录: |