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.

有帮助吗?

解决方案 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.

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top