I'm making a simple app that shows information for a game and decided to use the character avatars as the ImageButton to switch to the page that has information on them, but when they are pressed they do not switch the Activity
The xml for the ImageButton
<ImageButton
android:id="@+id/GoToMarauder"
android:layout_width="62dp"
android:layout_height="66dp"
app:srcCompat="@mipmap/marauder_avatar"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="-4dp"
app:layout_constraintRight_toLeftOf="@+id/GoToTemplar"
android:layout_marginRight="86dp" />
The onClick listener
ImageButton GoMarauder;
....
GoMarauder = (ImageButton) findViewById(R.id.GoToMarauder);
.....
GoMarauder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent GoMarauder = new Intent(Classes.this, Marauder.class);
startActivity(GoMarauder);
}
});