Android Question CallSub when Activity Paused

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Hello,
I use a service to do a request http to a web server.
I need to execute this request, even when the user exit from the app.

How can I do?
 

qsrtech

Active Member
Licensed User
Longtime User
Did you set it to true and restart your device? Seems to work for me. And that will just start the service. You still have the issue of calling your "activity" sub...
 
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Did you set it to true and restart your device? Seems to work for me. And that will just start the service. You still have the issue of calling your "activity" sub...
Can you post me your service code?
 
Upvote 0

qsrtech

Active Member
Licensed User
Longtime User
Can you post me your service code?
Mine is very similar. I have a timer that fires 10 seconds after the service starts which then starts my "main" activity. The sole purpose of that particular service is to in effect have a launch at boot app.
 
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
But do you start the main activity every time?
 
Upvote 0

qsrtech

Active Member
Licensed User
Longtime User
But do you start the main activity every time?
In that particular case it just launches the main app at boot and turns off the timer. I realize you have code you want to execute in your activity, that's a whole other issue. I was just replying to your question about starting your service when the device is "powered on". Is it possible to move the code you want to run to the service? I'm not sure putting it in a code module will help since I don't believe you can use "callsub" for a code module, unless somethings been improved without my knowledge
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…