Giusy Active Member Licensed User Aug 22, 2018 #1 Hi, I want, when the app is in background, only call a little sub. It's possible, and how? Thanks
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Aug 22, 2018 #2 Background Fetch could help you here. It will wake the app up at intervals. https://www.b4x.com/android/forum/threads/background-fetch-downloads.56022/ Upvote 0
Background Fetch could help you here. It will wake the app up at intervals. https://www.b4x.com/android/forum/threads/background-fetch-downloads.56022/
Giusy Active Member Licensed User Aug 22, 2018 #3 Oh @andrew it's too complex for me. In effect when my mp3 play and the user press the home button (of the device), I want only modify my button in "pause". What do you think, I have to give up? Upvote 0
Oh @andrew it's too complex for me. In effect when my mp3 play and the user press the home button (of the device), I want only modify my button in "pause". What do you think, I have to give up?
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Aug 22, 2018 #4 I think you may find the correct solution here: https://www.b4x.com/android/forum/threads/application-life-cycle.45935/#content Do you want to know when the app is moving to background? or do you want to perform processing whilst the app is in background? Upvote 0
I think you may find the correct solution here: https://www.b4x.com/android/forum/threads/application-life-cycle.45935/#content Do you want to know when the app is moving to background? or do you want to perform processing whilst the app is in background?
Giusy Active Member Licensed User Aug 22, 2018 #5 I want to know when the app is moving to background and call my sub Upvote 0
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Aug 22, 2018 #6 ok, so it looks like you need to handle the Application_background event. Code: Copy sub Application_background Log ("App Moving to Background") ' Your code here end sub Upvote 0
ok, so it looks like you need to handle the Application_background event. Code: Copy sub Application_background Log ("App Moving to Background") ' Your code here end sub
Giusy Active Member Licensed User Aug 22, 2018 #7 In fact this sub scares me much less than the others. I'll try it and tell you something. Thank you very much Upvote 0
In fact this sub scares me much less than the others. I'll try it and tell you something. Thank you very much
Giusy Active Member Licensed User Aug 22, 2018 #8 Hi @andrew with a breakpoint the program don't execute the sub Attachments background.PNG 7.3 KB · Views: 491 Upvote 0
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Aug 22, 2018 #9 Not sure what your problem is. I have just added the log message to the to a brand new app and it works fine for me. Upvote 0
Not sure what your problem is. I have just added the log message to the to a brand new app and it works fine for me.
Giusy Active Member Licensed User Aug 22, 2018 #10 Hi, @andrew even me in a simple program works. Can it be due to the fact that I use a timer and the following routine? Code: Copy Sub Timer1_Tick If Main.sploroISPLAYING =True Then label1.Text = ConvertToTimeFormat(SPLORO.Position) & " di " & ConvertToTimeFormat(SPLORO.Duration) Else Return End If End Sub Upvote 0
Hi, @andrew even me in a simple program works. Can it be due to the fact that I use a timer and the following routine? Code: Copy Sub Timer1_Tick If Main.sploroISPLAYING =True Then label1.Text = ConvertToTimeFormat(SPLORO.Position) & " di " & ConvertToTimeFormat(SPLORO.Duration) Else Return End If End Sub
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Aug 22, 2018 #11 Why don't you add a timer to the simple program and see what happens. Upvote 0