Ah man, the problem is still there, I'm banging my head against a wall.
so I think the fundamental question I need to answer is this:
Click app icon for first time, main activity starts. If you then click the PerformTest button, a 2nd activity is started - PerformTest.
** Activity (main) Create, isFirst = true **
starting main
** Activity (main) Resume **
** Service (unit_comms) Create **
** Service (unit_comms) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (performtest) Create, isFirst = true **
** Activity (performtest) Resume **
Now put the app in the background by clicking the android circle button
** Activity (performtest) Pause, UserClosed = false **
Desktop is shown. Now click the app label to get back onto the app. This kills the previous instance, whatever that means, and starts a new instance of main.
Killing previous instance (main).
** Activity (main) Create, isFirst = false **
starting main
WakeLock already held.
** Activity (main) Resume **
In main, my code determines that the last activity the operator was in was PerformTest, so it starts that activity again (if it is paused or null), the code looks like this:
Sub Activity_Resume
If isInPerformTest = True Then
IfIsPaused("PerformTest") = True Then
StartActivity(PerformTest)
EndIf
EndIf
End Sub
This is what happens in the log:
** Activity (main) Pause, UserClosed = false **
** Activity (performtest) Resume **
PerformTest activity seems to load up OK, now I click a button on PerformTest screen, and instantly my app disappears and I'm looking at the desktop.
The log only shows this:
** Activity (forcedtest) Pause, UserClosed = false **
If I put a breakpoint on the CLICK function of that button, I do end up hitting the breakpoint, but the Activity has disappeared off the screen by that stage. Hence, I can't seem to step through code to isolate at which point the activity flies off.
So, getting back to what my actual question is - how do I return to my PerformTest activity under this set of circumstances, assuming that me calling StartActivity(PerformTest) from the killed and resurrected MAIN activty after app icon is clicked?