@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); OnClickListener btn1_events = new OnClickListener() { @Override public void onClick(View v) { Intent act = new Intent(MainActivity.this, Abc.class); startActivity(act); } }; findViewById(R.id.button1).setOnClickListener(btn1_events); }
|