I start the chooser activity
selectButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Open from"), PICK_IMAGE);
}
});
and I have to change an imageview
picture with the result, I'm not sure but the resultCode variable from onActivityResult
has -1 value
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == PICK_IMAGE) {
//get data and change imageView
}
}
But I don't know get the data from the Intent data to set the picture of the imageView