android give it to button code example
Example 1: onclicklistener in android studio
Name.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainActivity.this,FileName.class));
}
});
Example 2: xml button
<androidx.appcompat.widget.AppCompatButton