Closed ShandyukSergey closed 4 years ago
I am facing the same issue, as well
I have noticed it is about these two libraries that I have used for mediation over iron source advertisement
implementation 'com.ironsource.adapters:vungleadapter:4.3.1'
implementation 'com.vungle:publisher-sdk-android:6.5.3'
it is weird but when I remove these two it started to work normally 🤔
It also happens when you start a second dialog very quickly (~1s) after returning to the Activity that requested the permission.
I digged around a bit and found, that the previous DexterActivity
gets destroyed delayed (when the UI-Thread is idle again).
In the meantime the new DexterActivity
has appeared and registered its callback (aka PermissionListener
or MultiPermissionsListener
).
Then, after the new DexterActivity
has shown up, the UI-/Main-Thread gets idle and the old DexterActivity
gets destroyed. In that process the callback is removed even though it has been replaced by a new one.
I think, the issue would be fixed, if the lib would check, if the callback to be removed is still the callback that is expected to be there and has not been replaced.
As a consequence the DexterActivity
should pass itself to onActivityDestroyed
when it gets destroyed and the Dexter instance should check in its onActivityDestroyed
that the current activity is the activity that called the onActivityDestroyed
:
void onActivityDestroyed(Activity activityThatCalledOnActivityDestroyed) {
if (activity == activityThatCalledOnActivityDestroyed) {
...
}
}
that would also imply the null
-check
Thanks for the fix @binarynoise I'm releasing a new version with your fix.
Expected behaviour
MultiPermissionsListener called when reguest permissions from onPermissionGranted
Actual behaviour
MultiPermissionsListener is NOT called when reguest permissions from onPermissionGranted
Steps to reproduce
Version of the library
6.2.0