Android Question b4a v 8.30 global question

Addo

Well-Known Member
Licensed User
Longtime User
using target sdk 26 on note 4 my app working normal until i go to background if i click on the app icon again the app got recreated 'i am sure the the application did not terminated' by os to be recreated i expect the app to be opened with the last activity

any one face this problem or only me ?
 

Addo

Well-Known Member
Licensed User
Longtime User
it seems llike the application started again and its already running and the service is not recreated. when i remove the target sdk 26 no problems happened at all

even in the log the first activity did not terminated its seems like it got terminated when the app relunched


i did not mean by recreated the the activity got recreated no the application got relunched

logs

B4X:
int logctl_get(): open '/dev/hwlog_switch' fail -1, 13. Permission denied
Note: log switch off, only log_main and log_events will have logs!
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
 
Last edited:
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
This is the beginning of log it does not created again after the relaunch behaviour happened , I don't know why when removing the target sdk this behaviour did not happened this was tested on 2 devices note4 and Samsung s6 with android 7 .
If target sdk 26 this behaviour happened even on empty app , just bring the app to backgroud and try to bring it back to foreground from the launcher icon .

I have added a notification to the service to check if the app really killed by the os but it doesn't the notfication still there and I can go back to the activity from notification bar .

Other wise from the launcher icon I cannot go back to the activity because the app restarted , thats only happened when target sdk is set to 26
 
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
Clicking on home button yes but not to close the app even from somewhere else like clicking on other app notification , in any case the app is in background if it was killed I couldn't go back from notification icon. I can go back to the activity any time from notification icon , but from the launcher icon I cannot go back not even after half a second
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should explain the exact steps required to reproduce it.

This is what I get when I click on the home button and then on the app icon:
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
 
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
Android version ? I have no problem on android 6 phones with target sdk 26

The behaviour happened with android 7 specially on Samsung

I do exactly what you doing but the result is different
 
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
And its more likely with Samsung products note 4 is android 6 and have the same problem other wise Huawei p8 also have android 6 and does not have this behaviour

Its very weird. And what confusing me more is when I remove the targetsdk from xml I do not have issues at all on any of those devices
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
All my apps (exactly: apps of all "power users with big apps and thousands of users") work perfect and were updated to fit newest SDK requirements. This might be the reason why noone of us has reported an issue.

Always assume that your app/service/process can and will be destroyed. So assume that it is your code or the OS (e.g. energy savings) which kills a service.
 
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
All my apps (exactly: apps of all "power users with big apps and thousands of users") work perfect and were updated to fit newest SDK requirements. This might be the reason why noone of us has reported an issue.


Always assume that your app/service/process can and will be destroyed. So assume that it is your code or the OS (e.g. energy savings) which kills a service.

I have no one reported any issue thats not either tested in my app , I faced this behaviour by coincidence while running empty app on some old device also I did not reported any problems in the thread .
This was a general question about app icon clicking behavior under sdk 26 , if an empty app got an issue it should be showing in the debugger . How ever I don't think that your thousand users who use some cheap phones will report an issues about icon clicking app restarted behaviour .

Thats a thing I faced in note4 by coincidence if its code error it should raise an error on every device / android version.

@LucaMs no point from uploading empty project any ways seems I am the only one who got this behaviour on some old test devices that I own .
 
Upvote 0
Top