首先,您需要使用REQUEST_CODE启动Activity :
// Here we set a constant for the code. private final int REQUEST_CODE = 100; Intent i = new Intent(activity, EditInfoActivity.class); i.putExtra("id", list.get(position).getID()); activity.startActivityForResult(i, REQUEST_CODE);
然后,你需要发送RESULT_OK整理EditInfoActivity时:
Intent i = getIntent(); i.putExtra("isDataChange", isDataChange); setResult(RESULT_OK, i); finish();
然后使用以下方法处理第一个活动的结果:
Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // REQUEST_CODE is defined as 100 if (resultCode == RESULT_OK && requestCode == 100) { // do process } }