Samsung Note strange behaviour with activity sequence

lagore

Active Member
Licensed User
Longtime User
I have an app with several activities and have noted a very strange behaviour of activity sequence on the Samsung Note. When the app is started it correctly moves into 'Main' then one of my activities (kalenderactivity) is to select the date, the normal flow on all devices so far is,
** Activity (main) Pause, UserClosed = false **
** Activity (kalenderactivity) Create, isFirst = true **
** Activity (kalenderactivity) Resume **
** Activity (kalenderactivity) Pause, UserClosed = true **
** Activity (main) Resume **
which is correct because the app never goes into the background.
But on the Samsung Note the flow is
** Activity (main) Pause, UserClosed = false **
** Activity (kalenderactivity) Create, isFirst = true **
** Activity (kalenderactivity) Resume **
** Activity (kalenderactivity) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
It goes thru 'Activity (main) create' again and resets all of the globals and causes problems down the line.
The Note is running 4.1 but all of the other devices are running 2.3 up to 4.2 with no problems.
I would be interested if anybody with a 'Note' has seen this problem, unfortunately I only had access to the Note for a short while so cannot do any further debugging.
 

mc73

Well-Known Member
Licensed User
Longtime User
Sorry, I forgot the other part. Are you also using activity.finish in main, when opening your second activity? If so, it's quite natural to have activity_create triggered upon returning.
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
No I do not finish the 'main' activity and either way I would have thought that all versions of android would follow the same flow.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Ok. My advice is to properly finish activities before moving to the next one and save data you need to recall. About your specific issue, I simply find it strange and I would check orientation settings for a start.
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
All of the other activities except 'main' are finished but 'main' is the central one that they all come back to. This app has been running on multiple devices for over a year and all have worked as programmed except for the Note. It is as if the system is seeing 'main' for the first time on resume except for "isFirst = false ". I will have to try and get my hands on one and do a bit more digging.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
A final thought: Is there a chance that the particular Note you tested, had the 'don't keep activities' setting checked?
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
That option sounds like the one that might be causing the problem (I never heard of it before) I will contact the user and get him to check that setting. I will report back.
Thanks
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
Well caught mc73 that item was in fact checked not sure why but it sorted out the problem, it causes no persistence between activities in case anybody else sees this thread.
Thanks
 
Upvote 0
Top