//传值 getIntent().putExtra("useraddress",userAddressBeanList.get(position)); setResult(10,getIntent()); finish();
接收的区域复写:
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 2 && resultCode == 10) { userAddressBean = (UserAddressBean) data.getSerializableExtra("useraddress"); } }
requestCode为Activity跳转时传的值:
startActivityForResult(new Intent(this, AddressManagementListActivity.class), requestCode);
resultCode为setResult传的值:
setResult(resultCode,Intent());