I solved it with new task flag and passing parameters in phonestatelistener. Interesting that sometimes phone state changes during calls almost "at random", so it gives a hard time to handle the cases on all phones and os versions.
Bring dialer app into foreground from background when phone call is finished
-
25-06-2022 - |
Frage
This is the current mechanism:
- I make a phone call from my app (app stays in the background)
- Phone call ends
- The system fires
android.intent.action.view
and my app listens for it, so I can start my app to show call log.
The problem is, that a new instance of my app is being created, instead of taking the other into foreground. This is problem because loading the app again needs some time, and I need an instant, very fast action.
I would like to avoid the loading time, so this would be the ideal solution:
... 3. System fires intent, and my background app comes into foreground (instead of launching it again) and does it's job
I have read that posiibly it cannot be done because of security, but my app would start anyway, I just want to make it faster, so I hope there is a solution.
Lösung 2
Andere Tipps
Have you tried setting android:launchMode = "singleInstance" in your androidmanifest.xml?
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow