Android Question [SOLVED] CallSubDelayed from Resumable Sub // context destroyed

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
I often used a sub called from Activity_Resume to refresh a view when the app is to the foreground again. The sub calls itself. Today, instead of using CallSub at the end of the sub, I have used CallSubDelayed which had the following effect :
- the context is destroyed
- the resumable sub doesn't loop

Could someone explain me why the sub, included in a foreground activity seems to be unreachable ? Many thanks

Sleep not resumed (context destroyed): b4a.test.context.main$ResumableSub_refresh_LV
 

Attachments

  • sample.zip
    12.6 KB · Views: 176

LucaMs

Expert
Licensed User
Longtime User
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (srv1) Create ***
** Service (srv1) Start **
08/06/18 17:45:04 Size: 1
08/06/18 17:46:04 Size: 2


It seems to work well... here.

I used an Android 4.4.2.

I had to change only line 17 of srv1 from:

DateTime.DateFormat="dd/MM/YY"

to:

DateTime.DateFormat="dd/MM/yy"
 
Last edited:
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Thanks so another time, all seems to work well outside my own setup...
Could you please be kind enough to upload a release APK (if you have some time of course).

Here I have tested with some devices (7.0, 7.1.1). It was compiled with B4A 8.0, Android 27 and Jdk-10.0.1
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Yes and your APK is OK too on the first phone I had tried and where I noticed my problem the first time. Thanks for the effort you provided. It on my end so
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…