I am having a imageView in one class and on clicking the imageView a dialog box appear which has two option to take a image from camera or open the image gallery of device.
My preferred way (and I think the most straight-forward way) is to use an own Application instance in the app, to store variables that are common to more than 1 activity.
Create a class, let's call it MainApplication
that extends android.app.Application
and declare it in the manifest:
Then you get an instance of the application object in the Activity like this:
MainApplication application = ((MainApplication)getApplication());
Inside this application object you can store any app-level data and use it as usual:
application.setImage(...);
application.getImage();