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

CyclopDroid

Well-Known Member
Licensed User
Longtime 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
 

CyclopDroid

Well-Known Member
Licensed User
Longtime 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

LucaMs

Expert
Licensed User
Longtime User
I never play with widgets :D , but have you tried putting StartService within Service_Destroy?
 
Upvote 0

CyclopDroid

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

LucaMs

Expert
Licensed User
Longtime User
I have tried right now using the Erel's widget (tutorial).

I added:
StartActivity (Me)

within:
ServiceDestroy

After that, I "terminated" the app via system commands (Manage apps) and the widget seems still working.
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime 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

LucaMs

Expert
Licensed User
Longtime User
Well, as you know, your widget does not work on my smartphone!

The Erel's example is not so complicated!

Just wait for an expert ;)
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime 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
Longtime User
Upvote 0

CyclopDroid

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

LucaMs

Expert
Licensed User
Longtime 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