I am using a toolbar as my actionbar in an activity. I am trying to add the method getActionBar().setDisplayHomeAsUpEnabled(true); to the Activity.java file fo
getActionBar().setDisplayHomeAsUpEnabled(true);
Try this :
setSupportActionBar (toolbar); if(getSupportActionBar () != null) { assert getSupportActionBar () != null; getSupportActionBar ().setDisplayHomeUpEnabled(true); }
Note that setSupportActionBar(toolbar) should be before getSupportActionBar().