Activity通过Intent传递对象和参数
2017-07-20 16:08
375 查看
Intent myIntent = new Intent();//插入参数 Bundle bundle = new Bundle(); bundle.putInt(Constant.INTENT_ID, event.getOrderId()); bundle.putInt("GroupId",event.getGroupId()); bundle.putInt("OrderId",event.getOrderId()); bundle.putSerializable("list",(Serializable)event.getEmployeeList()); myIntent.putExtras(bundle); myIntent.setClass(this.getActivity(), SelectRoleActivity.class); startActivity(myIntent);
Bundle bundle = this.getIntent().getExtras();//读取groupId = bundle.getInt("GroupId");orderId = bundle.getInt("OrderId");rowList = new ArrayList<>();rowList = (List<Employee>)bundle.getSerializable("list");employeeId = getPreferenceHelper().getInt(Constant.SHARED_EMPLOYEE_ID, -1);
相关文章推荐
- Activity间通过Intent传递Bitmap对象
- Android:通过Intent在两个Activity之间传递对象(Parcelable)
- 用Intent 对象实现两个(多个)Activity之间的跳转和参数传递
- notification通过intent传递参数到activity
- Android 如何通过Intent在activity之间传递自定义对象 推荐
- Activity之间通过Intent传递对象
- [转」notification通过intent传递参数到activity
- Android-->intent-filter 过滤规则的匹配 (Activity通过Uri传递参数)
- [转」notification通过intent传递参数到activity
- Android Activity通过 Intent 传递类对象
- 使用Intent对象来实现两个(或多个)Activity之间的跳转,并实现在Activity之间传递参数。
- Android 开发笔记——通过 Intent 传递类对象
- Android中如何使用Intent在Activity之间传递对象[使用Serializable或者Parcelable]
- 通过Intent传递类对象
- android通过ksoap访问webservice方法传递一个复杂对象参数
- Activity间通过Intent传递对象的方法
- 页面之间通过Intent传递Model对象
- 将一个对象通过Serializable 传递到另一个Activity中时,这对象在原来的Activity中是否可同步更新?
- Android中如何使用Intent在Activity之间传递对象[使用Serializable或者Parcelable]
- 【TIP_4】Intent传递对象,在Activity和Fragment中再获取是否为新对象