Android Question using the cropped image of previous activity

Tt1993

Member
Hi. how can I use the cropped image of previous activity( imagine the first activity crops the input images) in an new activity in b4a?
 

drgottjr

Expert
Licensed User
Longtime User
if you're talking about 1 app with multiple activities, an easy way is to refer to the cropped bitmap in activity 1 as a process global. you can then start up activity 2 and have it see what's doing with the process global bitmap from activity 1. and go from there.

otherwise, if you're interested in the google ethos of share and share alike, then search for file sharing in the little box above (next to your user id). you need sharing as a sender (activity 1) and as a receiver (activity 2). not difficult. numerous examples available.

i'm guessing you want to write both activities, so after you crop your image and make it available for other apps in activity 1, and you have made activity 2 available for receiving shared images, you will see activity 2 in a list of apps that accept shared images. if you only want your app to be selected, you can set that.

there are other variations. eg, you may already have an app that crops images on your device that shows the share icon. in that case, you don't have to write activity 1. you only have to write and register activity 2 as one that can receive shared images. likewise, you might only have to write the cropping app and set it to share the cropped image. other apps (already on your device) may be registered to receive shared images. in that case, you wouldn't have to write activity 2.

if you follow the examples, everything works as expected.
 
Last edited:
Upvote 0
Top