Skip to content

Instantly share code, notes, and snippets.

@bluemyria
Last active March 7, 2018 10:04
Show Gist options
  • Save bluemyria/81103be2e6adc2c59c8ee0b4d72cad45 to your computer and use it in GitHub Desktop.
Save bluemyria/81103be2e6adc2c59c8ee0b4d72cad45 to your computer and use it in GitHub Desktop.
Android - 008 - OnClickListener for multiple buttons
private class myOCL implements View.OnClickListener {
@Override
public void onClick(View view) {
Intent myIntent;
switch (view.getId()) {
case R.id.btnWortPaar1:
myIntent = new Intent(MainActivity.this, WortPaar2Activity.class);
startActivityForResult(myIntent, 1);
break;
case R.id.btnSuchen1:
//myIntent = new Intent(MainActivity.this, Suchen3Activity.class);
//startActivityForResult(myIntent, 1);
break;
case R.id.btnWoerterListe1:
myIntent = new Intent(MainActivity.this, WoerterListe4Activity.class);
startActivityForResult(myIntent, 1);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment