Android Question activity.finish

merlin2049er

Well-Known Member
Licensed User
Longtime User
I've got a small app that looks up and dials a number, then I'd like to exit the app.

B4X:
For Each Phone As cuPhone In cu.GetPhones(c.Id)
                       
                  If Phone.PhoneType = "other" Then
                         dial(Phone.number)
                       
                        Activity.Finish   
                 End If
.
.
.

Sub dial(number As String)

Dim i As Intent
    i.Initialize(i.ACTION_CALL, "tel:" & number)
StartActivity(i)


End Sub

I'm not sure why it continues to run further code in activity create, even after the activity.finish command...
 

Gunther

Active Member
Licensed User
Longtime User
Just for info:

As you may know, Erel doesn't like the
B4X:
ExitApplication

His approach is that the OS should decide to finish the app completely, which one can do with
B4X:
Activity.Finish
 
Upvote 0
Top