Android Question Starting the Starter service from Receiver_Receive

Alessandro71

Well-Known Member
Licensed User
Longtime User
While converting a widget-based app from SDK 30 to SDK 31, I'm facing the issue of not having the Starter service running at the first Receiver_Receive call.
I'm using the Starter service to initialize many of the data structures the widget is using (SQLite DB, Localizator, Logging...)
Is StartService(Starter) as the first action of Receiver_Receive a viable solution?
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
Answering my own question: it works on a Android 11 device, while it fail miserably on Android 12 with

android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service com.xxx/.starter
 
Upvote 0
Top