xml - android.view.MenuItem android.view.MenuItem.setVisible(boolean)' on a null object reference -
public boolean onprepareoptionsmenu(menu menu) { boolean draweropen = mdrawerlayout.isdraweropen(mdrawerlist); menu.finditem(r.id.action_websearch).setvisible(!draweropen); return super.onprepareoptionsmenu(menu); } <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/action_websearch" android:icon="@drawable/action_search" android:title="@string/action_websearch" android:showasaction="ifroom|withtext"/> </menu>
Comments
Post a Comment