Collect v1.17.0
Buttons in android permission dialog don't cause any action if an activity has been recreated after showing the dialog.
It's one of many possible ways to reproduce the issue:
If you click Deny another dialog with an explanation should be displayed otherwise (allow) an external app (audio recorder) should be started.
It's caused because we pass activity https://github.com/opendatakit/collect/blob/master/collect_app/src/main/java/org/odk/collect/android/utilities/PermissionUtils.java#L160 and after activity recreation, there is no reference to a current activity . We could fix this issue using for example rxEvents but it would make the code complex and then I don know if using the library we use makes sense.
This problem doesn't exist using the approach from the doc https://developer.android.com/training/permissions/requesting
any other approaches @jd-alexander ?
Interesting. I think we鈥檙e probably not using the lib quite as it is intended. Have you maybe looked at some of the samples linked from https://github.com/Karumi/Dexter/issues/15?
Interesting. I think we鈥檙e probably not using the lib quite as it is intended. Have you maybe looked at some of the samples linked from Karumi/Dexter#15?
The methods that were introduced there were depreciated and then removed. Will be investigating what was implemented in favour of them.
I think we鈥檙e probably not using the lib quite as it is intended
It was also my first idea but then I downloaded the sample app https://github.com/Karumi/Dexter/tree/master/sample and the behavior there is the same.
@grzesiek2010 how about filing a new issue on the Dexter repo asking what the latest strategy may be and referring to issues at https://github.com/Karumi/Dexter/search?q=rotation&type=Issues
I鈥檓 not optimistic we鈥檒l get a response since there hasn鈥檛 been activity in a while but good to at least have it out there.
I鈥檇 say this is pretty low priority because it is recoverable and I doubt screen rotation is very common (maybe we should get analytics).
Here you are https://github.com/Karumi/Dexter/issues/216
https://github.com/Karumi/Dexter/issues/216#issuecomment-426629403
The short answer is that it was possible at some point but it was buggy so they decided to get rid of that functionality and they won't implement it again.
So now the question is. Is it acceptable for us or maybe we should use the traditional approach https://developer.android.com/training/permissions/requesting?
Great that you got a response!
I'm ok leaving it as-is. The permissions requests don't happen often anyway and even when they do, the odds of a user deciding to rotate at just that moment are low. So I think we can close this.
It sounds like #2571 is also explained by https://github.com/Karumi/Dexter/issues/216#issuecomment-426629403 and that we can close that one as well, right?
Since as you said:
so I agree we can close this issue. When it comes to #2571 I think we can fix it and it's not the same, let me take another look to be sure.
Most helpful comment
Here you are https://github.com/Karumi/Dexter/issues/216