Android Question how to use SetExactAndAllowWhileIdle

Mark Ryan Penafiel

Member
Licensed User
Longtime User
I tried to follow Background location tracking example, need it running in foreground without being killed. Ater some hours, i checked. Foreground notification stopped.
I tried to look how to prevent it from stopping i saw SetExactAndAllowWhileIdle, but when i tried to replace StartServiceAt with SetExactAndAllowWhileIdle , it says Undeclared variable 'setexactandallowwhileidle' is used before it was assigned any value.

Another question
should i put this SetServiceAttribute(Tracker, android:foregroundServiceType, "location") in the manifest even some of the phones are not android 10+
i didnt saw this in the manifest

Thank you
 

DonManfred

Expert
Licensed User
Longtime User
You are using which B4A Version? Note that it is a mistake not to use V9.8 as it is free now.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User

It is a custom member sub.

It is not needed in b4a 8+
 
Upvote 0
Top