My app has 2 activities, let say Activity1 and Activity2. I write the code for Activity1 first so in the manifest it is my Main Activity. I then realize that I want to have an activity that start before it, so I create Activity2. In the manifest I make changes so that Activity2 will be called first when my app is launched.
My question is, looking at the log, when my app is launched, "Activity2 Create" is not shown. After that, from Activity2, I press a button to call up Activity1. Now the log shows "Activity1 Create", "Activity1 Resume". So, why is the "Activity2 Create" info missing? Is it normal?
Secondly, if I'm in Activity1, and I press HOME button, if I'm not wrong, both activities will be paused? But, for my case, only Activity1 is paused. No log info on Activity2...After that, I immediately launch my app again. My app is still in memory so Activity1 is supposed to be un-paused and I supposed to see Activity1, but no, it starts with Activity2.
Thirdly, everytime Activity1 is called with StartActivity command, it starts with Activity_Create sub, not Activity_Resume (log shows Activity1 Create -> Activity1 Resume)
Can anyone explain what is happenning....
P/S below is full log and step be step how I get the log:
Installing file.
PackageAdded: package:b4a.example 'Launch App, App starts with Activity (2)
** Activity (1) Create, isFirst = true ** 'Press a btn in activity (2), with StartActivity(1)
** Activity (1) Resume **
** Activity (1) Pause, UserClosed = true ** 'Press BACK key
** Activity (2) Resume **
** Activity (2) Pause, UserClosed = false ** 'Press the btn in activity (2) again
** Activity (1) Create, isFirst = false **
** Activity (1) Resume **
** Activity (1) Pause, UserClosed = true ** 'Press BACK key
** Activity (2) Resume **
** Activity (2) Pause, UserClosed = false **
** Activity (1) Create, isFirst = false ** 'Press the btn in activity (2) again
** Activity (1) Resume **
** Activity (1) Pause, UserClosed = false ** 'Press HOME key
Killing previous instance (2). 'Launch the app again
** Activity (2) Create, isFirst = false **
** Activity (2) Resume **
** Activity (2) Pause, UserClosed = false **
My question is, looking at the log, when my app is launched, "Activity2 Create" is not shown. After that, from Activity2, I press a button to call up Activity1. Now the log shows "Activity1 Create", "Activity1 Resume". So, why is the "Activity2 Create" info missing? Is it normal?
Secondly, if I'm in Activity1, and I press HOME button, if I'm not wrong, both activities will be paused? But, for my case, only Activity1 is paused. No log info on Activity2...After that, I immediately launch my app again. My app is still in memory so Activity1 is supposed to be un-paused and I supposed to see Activity1, but no, it starts with Activity2.
Thirdly, everytime Activity1 is called with StartActivity command, it starts with Activity_Create sub, not Activity_Resume (log shows Activity1 Create -> Activity1 Resume)
Can anyone explain what is happenning....
P/S below is full log and step be step how I get the log:
Installing file.
PackageAdded: package:b4a.example 'Launch App, App starts with Activity (2)
** Activity (1) Create, isFirst = true ** 'Press a btn in activity (2), with StartActivity(1)
** Activity (1) Resume **
** Activity (1) Pause, UserClosed = true ** 'Press BACK key
** Activity (2) Resume **
** Activity (2) Pause, UserClosed = false ** 'Press the btn in activity (2) again
** Activity (1) Create, isFirst = false **
** Activity (1) Resume **
** Activity (1) Pause, UserClosed = true ** 'Press BACK key
** Activity (2) Resume **
** Activity (2) Pause, UserClosed = false **
** Activity (1) Create, isFirst = false ** 'Press the btn in activity (2) again
** Activity (1) Resume **
** Activity (1) Pause, UserClosed = false ** 'Press HOME key
Killing previous instance (2). 'Launch the app again
** Activity (2) Create, isFirst = false **
** Activity (2) Resume **
** Activity (2) Pause, UserClosed = false **
Last edited: