您的位置:首页 > 移动开发 > Android开发

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);

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android