Close one Activity from another Activity

Inman

Well-Known Member
Licensed User
Longtime User
Is it possible to close one activity from another activity? I desperately need this.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Not directly.
You can use a process global flag for this.
For example if you need to close Activity1 from Activity2. In Activity1 add a process global boolean variable named: ShouldIClose.
In Sub Activity_Resume:
B4X:
If ShouldIClose = True then 
 Activity.Finish
 ShouldIClose = False
End If

In Activity2 set Activity1 flag to true when you want it to close.
 
Upvote 0
Top