I am having difficulty returning information from an activity, my understanding of the implementation is incomplete.
What I want is the user to be able to click a button to load up the android gallery, select an image, that image (or link to the image perhaps) is converted to a bitmap/drawable which appears in my activity's UI layout.
I have the android gallery opening but I am not getting any response back from it (I know why, there are no intents in the gallery app - which I dont have access to in order to edit, but I dont know the solution)
ImageView galleryClick = (ImageView)findViewById(R.id.addgallery);
profilePic = (ImageView)findViewById(R.id.profilepic);
galleryClick.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, "Select Picture"),1);
}
});
What I was hoping was the onActivityFinished would be called in my handwritten activity, but that method is never called (I put a breakpoint in its code
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == 1) {
// currImageURI is the global variable I'm using to hold the content:// URI of the image
//currImageURI = data.getData();
}
}
}
solutions?