I have a game screen and in the middle of the game, the player can change theri profile pic by clicking a button. when the button is clicked, the following method is called
private static final int SELECT_PHOTOA = 100;
public void chgImageA(View v){
System.out.println("...changing profile a");
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("image/*");
startActivityForResult(photoPickerIntent, SELECT_PHOTOA);
}
Then in the onActivityResult method I have the following code
@Override
protected void onActivityResult(int requestCode, int responseCode, Intent intent) {
if (requestCode == SELECT_PHOTOA) {
if(responseCode == RESULT_OK){
Uri uri = intent.getData();
ImageButton pap= (ImageButton)findViewById(R.id.profileAButton);
pap.setImageURI(uri);
}
}
}
This calls the photo picker and changes the profile pic on the Imagebutton, but the parent activity that called this imagepicker activity is restarted. How do I get the first activity to resume from where it was? Any help would be greatly appreciated...thnakyou!!!