Question

This is the current mechanism:

  1. I make a phone call from my app (app stays in the background)
  2. Phone call ends
  3. 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.

Was it helpful?

Solution 2

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.

OTHER TIPS

Have you tried setting android:launchMode = "singleInstance" in your androidmanifest.xml?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top