I am new in Android. I have "Menu" activity in which I have ListView with 3 items. When I click on the first item it is opening new Activity ("Play" activity). In that activity I have a button which calls another activity "Result". I am trying to make in "Result" activity onBackPressed method which is return to the "Menu" activity. Here is a code, but this code just return to the "Play" activity:
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
finish();
}
Another code just back to "Menu" activity but doesn't close "Result" activity
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
Intent intent = new Intent(this , Menu.class);
startActivity(intent);
}
Please give me some idea how to handle it. Thanks.