Open ivannarino opened 7 years ago
This is going to be fun to fix 😃 @nex0s do you have a fix for this? Right now I'm not sure if there is an Android API to don't show this view in the background apps history.
Not really, I am going to do some tests.
I don't know why, but on some devices the DexterActivity is not finished. I used 'Activity Manager State' to check if the activity was still alive after accepting the permission. On the Nexus 5X 7.1.1 emulator, the DexterActivity is finished correctly.
One dirty workaround would be to add
android:excludeFromRecents="true"
on .DexterActivity
If we set android:excludeFromRecents
to true then we won't be able to open the activity if we close it while the permissions dialog is open and that'd be a huge problem.
I'm trying to reproduce the issue in my Nexus 5X but I haven't been able so far.
Hello everyone, i've bumped with the same issue, and via recents i even can return to the underlying activity and close it via click back :-) It is a very bad behavior. For my side i can fix it with following strings in my manifest:
<activity tools:node="replace" android:name="com.karumi.dexter.DexterActivity" android:theme="@style/Theme.Transparent" />
The issue is in attribute (in Dexter library)
android:launchMode="singleInstance"
According to the doc: https://developer.android.com/guide/topics/manifest/activity-element.html , the launchMode "singleInstance" is always started with new task. In my fix i use default (standard) launchMode.
I am also experiencing this issue. Has anyone found a fix yet? ( EDIT: @ultraon's Solution worked for me. would be nice not to have to override the activity declaration in the manifest to fix this though.)
Our app is experiencing issues with this as well. Having the dialog in a new task eliminates the idea of it being modal. The user can swipe that task away without interacting with the dialog. So we never get the callbacks for accept or decline.
@EmmettWilson I would suggest using @ultraon 's solution for the time being.
We found this when testing an upgrade from 2.3.1 and went ahead and blocked our upgrade of the library for our project until this is resolved.
As I started looking into how to fix this I found several other issues surrounding interactions with the back stack. @pedrovgs @Serchinastico Do you want me to enumerate them here, in separate issues, or just explain in a pull request? The best way to describe really is a video.
Hi @EmmettWilson
We prefer to have separate issues for every problem but if you already have a PR in your pocket to solve them together just do whatever takes you less time/effort.
@Serchinastico it works perfectly (see my comment on your PR) :+1:
Expected behaviour
My app should only have one entry in "Overview" mode (recent apps).
Actual behaviour
When the permission dialog is accepted, it adds a new entry in the "overview", in addition to the main one
Steps to reproduce
Call this when permission is not yet accepted
Version of the library
4.1.0
Tested on Samsung Galaxy S6, running Android 6.0.1 and 7.0.0
The new task created is :