Android Question How to catch intent Success/Fail ?

FrankBerra

Active Member
Licensed User
Hi all,
i am using an external gallery app to crop images and i am using the following syntax:

B4X:
Dim i As Intent
    i.Initialize("com.android.camera.action.CROP", ParseUri("file://" & GetPathFromContentResult(SelectedPhoto)))
    i.SetType("image/*")
    i.PutExtra("crop", "true")
    i.PutExtra("aspectX", 1)
    i.PutExtra("aspectY", 1)
    i.PutExtra("output", ParseUri("file://" & File.Combine(File.DirDefaultExternal, "Photo.jpg")))
StartActivity(i)
It works perfectly but when i come back to my app from the gallery app i don't know how to catch the intent result. I want to know if the intent completed succesfully or not.
Actually i am using the "Activity_Resume" in which i put some routines that check if the cropped image is there.
The problem is that this routines are executed every time i resume the app and in my opinion this is not the best programming tecnique ;)

Is there any better solution?

Thanks in advance
 
Top