Android: how to disable top left back button from SubSettings

主宰稳场 提交于 2020-01-06 02:15:14

问题


From Android Jellybeans, all sub-activities of Settings activity are having this back button at top left corner which calls the Settings activity. It behaves more like a 'up' button for navigation purpose.

I have android code, and I want to disable this button for few sub-activities like display, sound etc. in my build.

Any suggestions, where do I have to modify to disable this? I tried out removing

android:parentActivityName 

tag from particular Activity in the Manifest file, but it didn't work.


回答1:


Try this

getActionBar().setDisplayHomeAsUpEnabled(false);


来源:https://stackoverflow.com/questions/24821828/android-how-to-disable-top-left-back-button-from-subsettings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!