문제

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