How to update listview when back pressed from another activity android?

前端 未结 3 1942
北海茫月
北海茫月 2021-01-18 09:48

Hi how to update listView when back pressed in another activity. I am using database, where i am deleting particular row in one Activity, if back p

3条回答
  •  无人及你
    2021-01-18 10:37

    call finish() in Activity1

    Intent intent = new Intent(getApplicationContext(), Activity2.class);
    startActivity(intent);
    finish();
    

    In Activity2 override backPressed

    public void onBackPressed(){
        Intent i = new Intent(this,AdminActivity.class);
        startActivity(i);
    }
    

提交回复
热议问题