我有一个程序,其中使用正确的请求代码调用onActivityResult()和null intent参数。当该活动调用setResult()时,不调用onactivityresult。 onActivityResult()在startActivityForResult()
之后调用public void placeListActivity(View view) {
Intent placeListIntent = new Intent(this,
PlaceListActivity.class);
// startActivity(placeListIntent);
this.startActivityForResult(placeListIntent, 5);
}
protected void onActivityResult(int request, int result, Intent arg2) {
super.onActivityResult(request, result, arg2);
if (request == 5 && result == Activity.RESULT_OK) {
handleOnActivityResult();
}
第二项活动:
@Override
public void onBackPressed() {
if(status){
setResult(Activity.RESULT_OK);
finish();
}else{
super.onBackPressed();
}
}