I have 2 activities - Main and actPage2. Now I have a condition that when its met, the main activity should end and start the second activity(actPage2).
My problem is the code runs even after Activity.Finish line. The only way it works is when i add return after the activity.finish or use Else for the code below the condition
What am I doing wrong?
Code for the Main activity
Logcat Output
My problem is the code runs even after Activity.Finish line. The only way it works is when i add return after the activity.finish or use Else for the code below the condition
What am I doing wrong?
Code for the Main activity
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("page1")
If "A" = "A" Then
Log("They are the same")
StartActivity(actPage2)
Activity.finish
' Return
End If
Log("****Am down here***")
Log(2 + 4)
Log("********************")
End Sub
Logcat Output
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
They are the same '<-------------------- The condition is true and suppose to finish and start second activity
****Am down here*** '<--------------activity.finish did not work
6
********************
** Activity (main) Pause, UserClosed = true **
** Activity (actpage2) Create, isFirst = true **
** Activity (actpage2) Resume **