1. Download our Official Android App: Forums for Android!

Apps physical back button code

Discussion in 'Android Development' started by Amon Darthir, Mar 15, 2010.

  1. Amon Darthir

    Amon Darthir Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    27
    Joined:
    Feb 4, 2010

    Feb 4, 2010
    27
    0
    15
    how do you code the physical backbutton so that it will take you to the last screen you were on in your app ?
     

    Advertisement

  2. KlaymenDK

    KlaymenDK Android Expert
    Rank:
    None
    Points:
    143
    Posts:
    1,217
    Joined:
    May 29, 2009

    May 29, 2009
    1,217
    130
    143
    Denmark
    Use the onBackPressed() method of Activity. From the manual:
     

Share This Page

Loading...