java - ActionBar onClick listener- this is possible? -


how actionbar onclick listener? mean- global listener whole view, not actionbar child views

try use custom view.

  1. create layout want action bar

  2. add android:onclick attribute in xml

    android:onclick="handleclick"

  3. inflate somewhere in code

  4. use actionbar.setcustomview() method

  5. implement onclick method in java

    public void handleclick(view view) {     // code after click here } 

that should work !


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -