java - How to add back button arrow functionality in navigation bar -
i beginner programmer , resent started android developing. watched many answers , couldn't find answer witch fit me. have added arrow button in action bar, couldn't figure out how add navigation first loaded screen. mainactivity.java public class mainactivity extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); actionbar actionbar = getsupportactionbar(); if (actionbar != null){ actionbar.setdisplayhomeasupenabled(true); actionbar.sethomebuttonenabled(true); } drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); final actionbardrawertoggle toggle = new actionbardrawertoggle( this, drawer, toolbar, r.string.navigation_drawer...