getActionBar().setDisplayHomeAsUpEnabled(true) throws NullPointerException

前端 未结 4 1291
一整个雨季
一整个雨季 2021-01-03 00:36

This question is asked several times in stackoverflow and I have tried all of them. But unfortunately neither is working for me.

I am trying to implement the naviga

4条回答
  •  甜味超标
    2021-01-03 00:47

    You are inheriting from ActionBarActivity. Hence, you need to use getSupportActionBar(), not getActionBar(), to get at the appcompat-v7-supplied action bar backport.

提交回复
热议问题