Hi all,
I've been trying for days now and can't get any further.
Since the forced update to Android Target API 31 in the Playstore, I get the following error message on devices with Android >= 12 when adding or remove the widget to/from the homescreen :
After the error comes, the app takes about 2 minutes when you want to open it again. Sometimes Crash Window from Android also comes. The error is reproducible.
This also applies to Erel's example, which should serve as a guide to creating a widget.
I did not change anything in the example except the target version in the manifest. Then in this example the error comes as well.
What I have already tried :
- B4A 12.00 Beta included Core 11.81 with Android-33
- All possible variants with Service.AutomaticForegroundMode including removing the function and Service.StopAutomaticForeground in all variants.
- Android API 30 = No problem, Android API 31 = Failure, API 33 = Failure
- The problem is also in the live version of my app according to Google Play Console and not only with emulator devices.
What I also wonder why apparently no one else has this problem ? I have not found another thread about it. Am I perhaps doing something wrong ?
I've been trying for days now and can't get any further.
Since the forced update to Android Target API 31 in the Playstore, I get the following error message on devices with Android >= 12 when adding or remove the widget to/from the homescreen :
java.lang.RuntimeException: Unable to start receiver anywheresoftware.b4a.samples.homewidgets.widgetservice$widgetservice_BR: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service anywheresoftware.b4a.samples.homewidgets/.widgetservice
This also applies to Erel's example, which should serve as a guide to creating a widget.
Android home screen widgets tutorial - part I
Edit: widgets are handled with receivers now. See the attached example. This tutorial will explain how to implement your own home screen widgets (also named App Widgets). It is important to understand that the widgets are created and managed in another process, different than the process that...
www.b4x.com
I did not change anything in the example except the target version in the manifest. Then in this example the error comes as well.
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="31" />
What I have already tried :
- B4A 12.00 Beta included Core 11.81 with Android-33
- All possible variants with Service.AutomaticForegroundMode including removing the function and Service.StopAutomaticForeground in all variants.
- Android API 30 = No problem, Android API 31 = Failure, API 33 = Failure
- The problem is also in the live version of my app according to Google Play Console and not only with emulator devices.
What I also wonder why apparently no one else has this problem ? I have not found another thread about it. Am I perhaps doing something wrong ?