获取不到intent传递的数据
来源:互联网 发布:linux grep 完全匹配 编辑:程序博客网 时间:2024/05/22 14:21
在项目的页面跳转中,Activity启动顺序为:A—>B—->C——>A
其中A启动模式设置为Android:launchMode=”singleTask”
C通过intent传递参数给A,通过以下方式将无法获取,始终获取的是默认值。
@Override protected void onStart(){ super.onResume(); isHome = getIntent().getBooleanExtra(ConfigConts.IsHome, false); if (isHome) { mainViewPager.setCurrentItem(0); }}
解决方法:
在A中重写onNewIntent()方法
protected void onNewIntent(Intent intent) { super.onNewIntent(intent); // must store the new intent unless getIntent() will return the old one setIntent(intent); }
0 0
- 获取不到intent传递的数据
- activity之间使用intent传递数据时,获取不到数据
- Bundle中传递数据,获取不到的错误。
- Intent传递的数据
- Intent的数据传递
- Intent数据的传递
- Intent的数据传递
- Intent的数据传递
- Intent数据的传递
- Intent的数据传递
- BroadcastReceiver获取不到Intent的Extra
- Android Intent的数据传递
- Intent传递数据的方式
- Intent复杂数据的传递
- Android Intent获取不到值
- Intent传递数据和Bundle传递数据的区别
- android中intent传递数据的方式
- android笔记 Intent传递数据的方法
- Linux Miscellaneous Device
- android selector 备忘
- 借助listView实现parallaxListView
- Android利用canvas画各种图形
- 转!!URL和URI区别
- 获取不到intent传递的数据
- maven常见异常总结
- Python开发环境安装指南Edit
- Android 调用webService+回调接口+线程池工具类封装(支持json格式接口和xml格式接口)
- 常用的系统存储过程
- adb devices offline solution for Window Batch CMD
- csma_0
- 目前较为理想的视频格式是什么?
- LoRaWAN协议中文版_第5章 MAC命令