start an activity after button click

To start an activity, you need to use intents. And you can call this when a button is clicked like so:

Button myButton = (Button) findViewById(R.id.MY_BUTTON);
myButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
       Intent intent = new Intent(CurrentActivity.class, NextActivity.class);
       startActivity(intent);
    }

You can read more about starting activities here.

Leave a Comment