protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, 2);
}
protected void onActivityResult(int requestCode, int resultCode, Intent intent){
Uri selectedImage = intent.getData();
Bitmap image = BitmapFactory.decodeFile(selectedImage.toString());
ImageView image1= (ImageView) findViewById(R.id.imageView);
image1.setImageBitmap(image);
String ABC ="ABC";
}
I get null value for the Bitmap image. How should I change the code so that I can get the value?