S Scantech Well-Known Member Licensed User Longtime User Apr 28, 2019 #1 Im confused with the tutorial. I have 2 services which gets destroyed when app is in background. how do i prevent this from happening?
Im confused with the tutorial. I have 2 services which gets destroyed when app is in background. how do i prevent this from happening?
Erel B4X founder Staff member Licensed User Longtime User Apr 28, 2019 #2 Background location tracking Upvote 0
S Scantech Well-Known Member Licensed User Longtime User Apr 28, 2019 #3 I added your example in my service (only one of them). I had a timer running every 5 seconds and updating the notification. It is holding and not getting killed. My question, do i need the example in both services or 1 is sufficient. I am concerned the other service might get destroyed? So far both are holding. Upvote 0
I added your example in my service (only one of them). I had a timer running every 5 seconds and updating the notification. It is holding and not getting killed. My question, do i need the example in both services or 1 is sufficient. I am concerned the other service might get destroyed? So far both are holding.
Erel B4X founder Staff member Licensed User Longtime User Apr 29, 2019 #4 Scantech said: I had a timer running every 5 seconds and updating the notification Click to expand... This is not needed. Scantech said: My question, do i need the example in both services or 1 is sufficient Click to expand... One is enough. The foreground service will cause the app to be kept in the foreground state. See the last section in this tutorial: https://www.b4x.com/android/forum/threads/automatic-foreground-mode.90546/#content Upvote 0
Scantech said: I had a timer running every 5 seconds and updating the notification Click to expand... This is not needed. Scantech said: My question, do i need the example in both services or 1 is sufficient Click to expand... One is enough. The foreground service will cause the app to be kept in the foreground state. See the last section in this tutorial: https://www.b4x.com/android/forum/threads/automatic-foreground-mode.90546/#content