java - How to check if drop down menu of ActionBar is active -


i'm using actionbar extending appcompatactivity. how can check, if dropdown menu of actionbar opened @ moment.

i've tried in method. not fire if open drop down menu:

@override public boolean onoptionsitemselected(menuitem item) {     intent intent = new intent();      log.i("actionbar", "actionbar dropdown open @ moment");      switch (item.getitemid()) {         case r.id.preferences:             intent.setclass(startupactivity.this, preferencesactivity.class);             startactivityforresult(intent, 0);             return true;         case r.id.info:             intent.setclass(startupactivity.this, informationactivity.class);             startactivityforresult(intent, 0);             return true;         case r.id.contact:             intent.setclass(startupactivity.this, contactactivity.class);             startactivityforresult(intent, 0);             return true;         default:             return super.onoptionsitemselected(item);     } } 

it fires, if click on item of drop down menu. want check, if user clicks on three-dot menu.

enter image description here

try following method:

@override public boolean onmenuopened(int featureid, menu menu) {     // menu open     return super.onmenuopened(featureid, menu); } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -