I am making an android app that needs the MANAGE_EXTERNAL_STORAGE
permission (and the read/write permission before android 11). The app requests the permission the first time it starts (using the code of the accepted answer from here).
However, when the user provides the permission they have to manually press the back button to return to the app so it can continue its flow.
I have a file manager app on my phone that returns to the app automatically once the permission is granted. So I am looking for a way to implement this in my app as well, preferably using the new method google suggest instead of the now deprecated startActivityForResult
The app I mention is available on playstore here
What I tried?
Replaced the startActivityForResult
using ActivityResultLauncher
, which is the way google recommends, because startActivityForResult
is now deprecated, but it didn't really change the app's behavior/solve the problem. In fact, it seems to be receiving a rejected result whether the user accepts it or not.