How do I avoid onCreate() being called when starting an Activity?

后端 未结 5 368
难免孤独
难免孤独 2021-01-13 14:27

I want to reload an activity from stack.

I use startActivity() to start new activities. When I\'m on Activity D I want to reload Activity A

5条回答
  •  不知归路
    2021-01-13 15:06

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                this.finish();
                return true; 
        }
        return super.onOptionsItemSelected(item);
    }
    

    This will kill the child activity. So parent activity is not recreated

提交回复
热议问题