Saturday, 20 June 2015

android activity onActivityResult doesn't work?


to fix this, you should make sure you have this:

1, open the second activity by:
    Intent infoIntent = new Intent(view.getContext(), InfoActivity.class);
    startActivityForResult(infoIntent,1);

Note: you shouldn't use startActifity()!!!

2, return to the first activity by:

Intent infoIntent = new Intent();
setResult(RESULT_OK, infoIntent);
finish();






No comments:

Post a comment