java - How to call ic_action_overflow button(option menu )onclicklistner in oncreate of main class in android -


i need call onclicklistner ic_action_overflow button(option menu button) in oncreate of main class ....how write onclicklistner button..thanks in advance!

code should like...

public class mainactivity extends appcompatactivity  {      @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);      ic_action_overflow.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view arg0) {             //  todo auto-generated method stub             //body         }     });  }  } 

use performclick method

ic_action_overflow.performclick(); 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -