Wednesday, 4 November 2015

How to trigger the button in android without click the button in android

Very simply trigger the button without click the button in oncreate

Button bt1 = (Button)findViewbyId(R.id.btl);
bl.performClick();

bl.setOnClickListener(new OnClickListener() 
         {public void onClick 
         (View  v) { 
             Intent i = new Intent(getApplicationContext(), exampleActivity.class);
             startActivity(i);}
         });

No comments:

Post a Comment