List View should not load onBackPressed

2020-01-20 04:27发布

问题:

I have Three Activities Main Activity , Order Activity , Order Details Activity.

Order Activity has a list view . On click of list View Order Details activity is opened but on back pressed from Order Details Activity the list view is loading again how to stop list view from loading Again

Please Help

回答1:

@Override
protected void onResume() {
    //****put your list view setup you already create in oncreate() method
    super.onResume();
}

add bellow oncreate() method in main activity