Android: the problem of transferring an image and its URI between two actions

Can we transfer the image and image URI to other actions in one application using a package? Suggest me some way to do this?

USAGE: In fact, I did an operation that cuts the image taken from the camera or from the image stored on the SD card, depending on the user. and another application using a background image, and the border image is superimposed so as to see PHOTO FRAME .

So now I want to combine both applications so that the cropped image comes from the first application, should become the background image for the second application. Included in the photo frame. How can i do this?

+4
source share
2 answers

After saving the image on the SD card

use this to perform another action.

final Intent intent = new Intent(MyClass.this, TargetClass.class); final String root = Environment.getExternalStorageDirectory().getAbsolutePath(); intent.setData(Uri.parse(root + "/my/image/path/image.png")); startActivity(intent); 

if you are a receiver, you can get the path by calling

 Uri path = getIntent().getData(); 

in onCreate receiving activity. This is the standard way to check the path with other actions.

+4
source

Yes, you can pass a URI object, see the putParcelable method in http://developer.android.com/reference/android/os/Bundle.html , the URI already implements the Parcelable interface, you can use the appropriate get methods for get.If any an object that implements the Parcelable interface, we can pass it using the Bundle.

+1
source

All Articles