Activity A 中:
Intent intent = new Intent(SubmitAnswerActivity.this,FileActivity.class);
startActivityForResult(intent, 1);
Activity B 中:
Intent intent = new Intent();
intent.putExtra("fileUrl", mFilePath); //传回给A的东西
setResult(RESULT_OK,intent);
Activity A 中:
再接收B传给A的值
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if(requestCode==1){
if(resultCode==RESULT_OK){
String string = data.getStringExtra("fileUrl");
}
}
}
Intent intent = new Intent(SubmitAnswerActivity.this,FileActivity.class);
startActivityForResult(intent, 1);
Activity B 中:
Intent intent = new Intent();
intent.putExtra("fileUrl", mFilePath); //传回给A的东西
setResult(RESULT_OK,intent);
Activity A 中:
再接收B传给A的值
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if(requestCode==1){
if(resultCode==RESULT_OK){
String string = data.getStringExtra("fileUrl");
}
}
}