Yep Yep - 1 year ago 82
Android Question

Must be one or more of "getSupportActionBar().setDisplayOptions..."

I've had this line in my code for a while now:

getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_CUSTOM);

I recently updated to
compileSDKversion 23
, and after that I started getting this error:

Must be one or more of 'getSupportActionBar().setDisplayOptions...

And then it gives me a list of the possible options.

Does this mean anything bad will happen in my code? Have I done something wrong? Is there any fix?


Answer Source





You are using the appcompat-v7 action bar backport; you need to use the right ActionBar import for that to work.