Hi,
I am running a Code module and inside the Code Module I have a Sub like this:
CodeModule:
On the main Activity I am running the code from a button and when I press it I am doing the following:
Based on the above it works fine, and opens the activity and closes the previous activity which is what I want.
However, if I add a button to Activity2 and run the code:
It then seems to hide the app. (well hides the activity).
The part I need help with is somehow from the Code module to detect if CurrentActivity is the activity that is going to be open and not to run the code.
For Example:
CodeModule:
Anyone know how to stop the code based on the Activity name?
I am running a Code module and inside the Code Module I have a Sub like this:
CodeModule:
B4X:
Sub OpenActivity(CurrentActivity As Activity)
StartActivity(Activity2)
CurrentActivity.Finish
End Sub
On the main Activity I am running the code from a button and when I press it I am doing the following:
B4X:
Sub Button1_click
CodeModule.OpenActivity(Activity)
End Sub
Based on the above it works fine, and opens the activity and closes the previous activity which is what I want.
However, if I add a button to Activity2 and run the code:
B4X:
CodeModule.OpenActivity(Activity)
It then seems to hide the app. (well hides the activity).
The part I need help with is somehow from the Code module to detect if CurrentActivity is the activity that is going to be open and not to run the code.
For Example:
CodeModule:
B4X:
Sub OpenActivity(CurrentActivity As Activity)
'If CurrentActivity = "Activity2" Then Return '<< Need help with this line
StartActivity(Activity2)
CurrentActivity.Finish
End Sub
Anyone know how to stop the code based on the Activity name?