Android Question How not to kill the App from a cleaer?

erosmax

Well-Known Member
Licensed User
Hi all.
If I use an app that killall (like ZDbox, CClean), my widgets stops working. Another Widget into my phone not closing... how can do not to kill my widget?
Thanks
 

erosmax

Well-Known Member
Licensed User
If I lauch the ZDBox and press KillAll (but other app running automatically) my App terminate and the Widget not work.
It has the same effect as a ExitApplication.
Putting it in Debug Mode, I think I get a log output ... but I do not know where to put the control. There will be a way to detect if the app is closed it's, I think!
 
Upvote 0

erosmax

Well-Known Member
Licensed User
Nothing. If the exitapplication is called from another App, I dont intercept the part of block.
 
Upvote 0

erosmax

Well-Known Member
Licensed User
:confused:
I've this code into Service


B4X:
Sub rv_Disabled
If Main.FirstClick=True Then
   ToastMessageShow("The Widget is Closed",True)
  CancelScheduledService("")
  StopService("")
  Main.DestroyApp=True
  StartActivity(Main)
End If
End Sub

Sub Service_Destroy
   StartService(Me)
End Sub



....Not work. When I test my widget, it not respond! o_O
 
Upvote 0

erosmax

Well-Known Member
Licensed User
Thanks
 
Upvote 0

erosmax

Well-Known Member
Licensed User
Anyway the:

B4X:
Sub Service_Destroy
   StartService(Me)
End Sub

are incorrect for my project, because when I emove de widget of phone screen (rv_Disable), I exit application (with the Main.DestroyApp=True, in Main, I call ExitApplication for terminate it) ;)
The problem is when the App Cleaner terminate the App (Main).
 
Upvote 0

DonManfred

Expert
Licensed User
Upvote 0

erosmax

Well-Known Member
Licensed User
Up="Please Help me to find a solution" or "Please answer" :p
 
Upvote 0

LucaMs

Expert
Licensed User
Up="Please Help me to find a solution" or "Please answer" :p

oh, that shold be:
PHMTFAS

:D

I don't know why #6 don't works in your app. I suppose that you should simplify it.

Hopefully Erel help you.

Otherwise, you can try to send me the source (even if I'm busy until 2025, I'll try).
 
Last edited:
Upvote 0
Top