Android Question Widget stuck after closing app

Biswajit

Active Member
Licensed User
Longtime User
Hello, I am trying to add a widget to an existing project. I followed the new receiver method. Everything is working fine. But after I close the app and clear it from the recent list, the widget click events are not working.

Is there any way to keep the widget active after closing the app?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
But after I close the app and clear it from the recent list
The OS should start the process if it is not currently running. Killing the app from the recent apps list can cause it to misbehave. On some devices it puts the app in a state where the process will not start unless the user clicks on the app icon.

You can test it by restarting the device. The widget should behave properly. If not then something isn't configured properly.
 
Upvote 0

Biswajit

Active Member
Licensed User
Longtime User
Yes after restarting it was working perfectly but the problem was only occurring when removing the app from the recent list.

So I disabled the battery optimization for the app and now the widget is working properly even after removing the app from the recent list.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…