ActionBar 'up' button destroys parent activity, 'back' does not

前端 未结 4 625
旧巷少年郎
旧巷少年郎 2020-12-13 01:48

I have a relatively simple Android app with one Activity showing a list of items and another showing details of a selected item. I start the list activity, whi

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 02:29

    when you specify parent activity in manifest then it gets restarted when you click on up Navigation button in action bar.

    check this i already answered this question

    https://stackoverflow.com/a/32401235/3479012

    you need to override up nevigation button in actionbar by accessing it by android.R.id.home in onOptionsItemSelected and do finish top activity.

提交回复
热议问题