Android Question StarterService with Widget on SDK 29 not getting called

Acuario

Member
Licensed User
Longtime User
Hi,
I am playing with the Widget clock from the tutorial:
https://www.b4x.com/android/forum/t...widget-more-frequently-than-30-minutes.11329/

It works ok from the sample code but I get a warning in the log:
The recommended value for android:targetSdkVersion is 29 or above (manifest editor). (warning #31)

So I updated the Manifest to:
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>

Now the Widget displays but does not get updated. I added some logging to the code and I see that the line 'StartServiceAt......' is called but the service never gets restarted.

Here is my log from the working widget with the following in the manifest '<uses-sdk android:minSdkVersion="4"/>':

And here is the log from the Widget that does not get updated with the manifest '<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>':
 

Zoran Vujacic

Member
Licensed User
I rarely write but I have worked a lot and read about the background (foreground) app.
Xiaomi phones require to lock app in recently used apps.

They simply stop all applications that are not locked in memory.
It cannot be solved programmatically.
1. press the "Recently used apps" button
2. long click on Your apps
3. press the padlock icon

I hope I helped you a little
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…