需求
OneActivity向TwoActivity传值name=hzs,然后TwoActivity向OneActivity传值sex=Y
第一步:OneActivity向TwoActivity传值name=hzs
OneActivity 里设置
Intent intent = new Intent(OneActivity.this,TwoActivity.class); |
TwoActivity 里取值
Intent getIntent = getIntent(); |
第二步:TwoActivity向OneActivity传值sex=Y
TwoActivity 里设置
Intent intent = new Intent(); |
OneActivity 里取值
@Override switch(requestCode){ case 2000: if(resultCode==1){ String sex = data.getStringExtra("sex"); } break; default: } super.onActivityResult(requestCode, resultCode, data); |