Android Question activity.finish

Discussion in 'Android Questions' started by merlin2049er, Jun 17, 2015.

  1. merlin2049er

    merlin2049er Well-Known Member Licensed User

    I've got a small app that looks up and dials a number, then I'd like to exit the app.

    Code:
    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...
     
  2. Douglas Farias

    Douglas Farias Expert Licensed User

    Try use
    Code:
    ExitApplication
     
  3. merlin2049er

    merlin2049er Well-Known Member Licensed User

    Thank, didn't know that existed. Lol.
     
  4. Gunther

    Gunther Active Member Licensed User

    Just for info:

    As you may know, Erel doesn't like the
    Code:
    ExitApplication
    His approach is that the OS should decide to finish the app completely, which one can do with
    Code:
    Activity.Finish
     
  5. merlin2049er

    merlin2049er Well-Known Member Licensed User

    Thanks, I used both (just in case) !
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice