Solution :
I have understood your problem. Please go through below solution on it.
The easiest way to achieve this is with the use of intent.
First you must create the static
variable in one of the class as below :
public class MyClass{
public static Bitmap MYPHOTO = null;
}
After that you should get the bitmap from a gallery just to save that bitmap in your MYPHOTO variable.
If you are willing to get the photo from your camera then code is as below.
Intent myintent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(myintent, CAMERA_PIC_REQUEST);
After this you should write below code:
@Override
public void onActivityResult(int myrequestCode, int myresultCode, Intent mydata) {
if (myresultCode == Activity.RESULT_OK) {
switch (myrequestCode) {
case CAMERA_PIC_REQUEST:
Bitmap myb = (Bitmap) mydata.getExtras().get("mydata");
if (myb != null) {
MyClass.MYPHOTO = myb;
}
break;
}
}
Now you can use your MYPHOTO variable in any other Activity.
You can use the same way if you want to pick photo from the gallery.