islander Member Licensed User Aug 21, 2017 #1 Does B4A support Context.startForegroundService() for Android O? If it does, what is the B4A code for Context.startForegroundService()? Thank you.
Does B4A support Context.startForegroundService() for Android O? If it does, what is the B4A code for Context.startForegroundService()? Thank you.
KMatle Expert Licensed User Longtime User Aug 21, 2017 #2 Yep. It's just B4X: Dim n As Notification n.Initialize n.OnGoingEvent=True n.Icon="icon" n.SetInfo("Scannservice aktiv","",Main) Service.StartForeground(1,n) Upvote 0
Yep. It's just B4X: Dim n As Notification n.Initialize n.OnGoingEvent=True n.Icon="icon" n.SetInfo("Scannservice aktiv","",Main) Service.StartForeground(1,n)
islander Member Licensed User Aug 22, 2017 #3 Thank you for the answer, but I think that is equivalent to B4X: startForeground(int, Notification) not the new B4X: Context.startForegroundService() that is added in Android O. See this for more details https://developer.android.com/refer...tartForegroundService(android.content.Intent) https://developer.android.com/refer...tartForegroundService(android.content.Intent) So, what is the B4A code for that new Android O method? Upvote 0
Thank you for the answer, but I think that is equivalent to B4X: startForeground(int, Notification) not the new B4X: Context.startForegroundService() that is added in Android O. See this for more details https://developer.android.com/refer...tartForegroundService(android.content.Intent) https://developer.android.com/refer...tartForegroundService(android.content.Intent) So, what is the B4A code for that new Android O method?
Erel B4X founder Staff member Licensed User Longtime User Aug 22, 2017 #4 For now you should keep the targetSdkVersion lower than 26 and everything will work as expected. Upvote 0