Android Question StartActivity and Activity.Finish

Harris

Expert
Licensed User
Longtime User
Is the following valid or prone to problems?

B4X:
Sub btnRead_Click
     ' Update table indicating user has read new instructions so they won't show next time he logs in..
     'UpdateUserTable
    
     StartActivity(unit_odom)
     Log("running act finish")
     Activity.Finish
     Log("ran act finish")
    
End Sub

Is it proper to call Activity.finish AFTER you have already started another activity?
 

JonPM

Well-Known Member
Licensed User
Longtime User
Only if you want the original activity closed for some reason. Generally, that reason is to prevent the user going back to the previous page via back button.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Only if you want the original activity closed for some reason. Generally, that reason is to prevent the user going back to the previous page via back button.
Yes, original activity won't be required again until this user logs out and the next user logs in... (it is single device mounted in a vehicle). No need to have it hanging around or showing up unexpectedly.

Thanks
 
Upvote 0
Top