Waiting for an activity inside a method channel method call and then returning results to flutter

391 views Asked by At

I have a method channel on flutter from which I call a native java method startCamera. The method startCamera spawns another activity to open camera with startActivityForResult. Now my problem is when the new activity is spanned with startActivityForResult the result is returned in onActivityResult callback and I want this to get returned where the camera activity is called since after starting new activity the method channel method will get destroyed and I will not be able to send the image url back to flutter. I just want to know is there a way to achieve this in Android. 1 way that I am thinkin of is to have an infinite loop on the method channel call handler that will check the value of a variable until it gets set inside onActivityResult asyncronously and return the url when the I gets the value

0

There are 0 answers