NullPointerException: with ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference

前端 未结 7 913

I get this nullPointerException on runtime:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method \'void android.app.ActionB

7条回答
  •  失恋的感觉
    2020-12-06 17:29

    This is clearly not the problem of OP, but other people may find it useful: for me the solution was to call setContentView(R.layout.activity_main) before the configuration of actionbar.

提交回复
热议问题