In my android app I display an activity with a fragment (A) in it. Based on the user choice when the location permission dialog is displayed, i want to display fragment (B) if the user clicks on 'deny' and the fragment (C) if the user clicks on 'allow' button.
While displaying the fragment (A), user is prompted with the Permission Request Dialog (let's say location permission):
There are the following 2 scenarios:
- the 'overview' button is pressed and then the app is recalled through the recent screen: the dialog is still visible. The user clicks on deny.
- the user presses the home button instead and reopens the app clicking on its icon on the 'All Apps' page, the dialog is not visible (automatically closed) and the result of the permission request from OS is deny.
How can i distinguish the two situations so:
- if the first path is followed the app can progress to fragment (B)
- if the second path is followed the app shows again the permission dialog?