使用intent传递map
来源:互联网 发布:centos git服务器配置 编辑:程序博客网 时间:2024/06/05 03:56
工具类
public class SerializableMap implements Serializable { private HashMap<Integer, Boolean> map; public HashMap<Integer, Boolean> getMap() { return map; } public void setMap(HashMap<Integer, Boolean> map) { this.map = map; }}
使用
//需要传递的mapHashMap<Integer, Boolean> xbksmap = new HashMap<Integer, Boolean>();Intent intent1 = new Intent(DetailNotifiActivity2.this, XbksAlertActivity.class); intent1.putExtra("flowname", flowname); Log.i("gjw", "协办科室被点击"); //传递map Bundle bundle1 = new Bundle(); SerializableMap tepmap1 = new SerializableMap(); tepmap1.setMap(xbksmap); bundle1.putSerializable("tepmap", tepmap1);
接收map
HashMap<Integer, Boolean> isSelected= new HashMap<Integer, Boolean>();HashMap<Integer, Boolean> tempIsSelected= new HashMap<Integer, Boolean>();Intent intent = getIntent();Bundle bundle = getIntent().getExtras();SerializableMap serializableMap = (SerializableMap) bundle.get("tepmap"); //两个map相互赋值isSelected = serializableMap.getMap();isSelected.putAll(tempIsSelected);
阅读全文
0 0
- 使用intent传递map
- Intent传递map集合
- Intent传递Map
- Intent传递List<Map<String,String>>的使用
- Intent传递List<Map<String,String>>的使用
- Intent、Bundle传递map集合
- 使用Intent传递对象
- 使用Intent传递对象
- 使用Intent 传递对象
- 使用Intent传递数据
- 使用Intent传递对象
- 使用Intent传递参数
- 使用Intent传递对象
- 使用Intent传递对象
- 使用 Intent传递 Bean
- Activity之间通过intent 传递Map
- 小问题之-intent 传递map集合
- andriod开发点滴(使用Bundle,Intent在Activity间传递map)
- mysql数据字段属性
- 在Vue.Js下使用el-input框 只能输入数字 并限制位数 并且限制中文输入以及粘贴
- 安卓 jni 开发 —— Android Studio 打包 so 的坑
- oracle数据库JDBC测试记录
- 数据结构入门3—莫队算法
- 使用intent传递map
- LeetCode 76 Minimum Window Substring(Python详解及实现)
- Vue安装运行
- Java的内存回收机制
- spring boot+spring security+thymeleaf在页面上判断用户是否登录
- iOS开发
- FragmentPagerAdapter与FragmentStatePagerAdapter区别
- Vue2.4组件间通信新姿势
- PHP 变量