Android Question [SOLVED] Close an activity and open another

Discussion in 'Android Questions' started by Vinians2006, Feb 22, 2015.

  1. Vinians2006

    Vinians2006 Active Member Licensed User

    I guys! Im using StartActivity(Another) to open an Activity called "Another", then when I need to go back to Main activity Im using StartActivity(Main), but the problem is when user push back key the android returns to "Another" activity. There are any way to really close an activity?
  2. Rob Rendle

    Rob Rendle Member Licensed User

    Sub Activity_KeyPress (KeyCode As Int) As Boolean
    If KeyCode = KeyCodes.KEYCODE_BACK Then startactivity (Main)
    End Sub
  3. Vinians2006

    Vinians2006 Active Member Licensed User

    Hey friend, thanks, but its not what I need. I need to know if I can Unload "Another" activity after I use it, like wipe it from memory so that back button cannot return to it again.
  4. NJDude

    NJDude Expert Licensed User

    Use Activity.Finish
    thedesolatesoul likes this.
  5. Vinians2006

    Vinians2006 Active Member Licensed User

    Worked! Thanks alot !
  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