I have an application that allow users to choose picture from native gallery then I show this image in image view widget.
My question is:
1-i have to send this image to another Activity. How can i do it.
2-in the receiver Activity i should show it in image view widget as in image not link or Something
I tried this code but it gives me a RunTime Error
Bitmap image = Bitmap.createBitmap(view.getWidth(), view.getHeight(),Bitmap.Config.RGB_565);
view.draw(new Canvas(image));
String url = Images.Media.insertImage(getContentResolver(), image,"title", null);
Just follow the below steps…
Uri uri = null;
1) on any click event use the below code to open native gallery
This will open gallery select picture will return you to your activity. OnActivity result.
2) Also instead of passing the image you can pass the URI to next activity as you pass string and inthe secont activity you get it using intent.
and in the second activity
Now you have string just set it to the image view like below