Skip to content

Instantly share code, notes, and snippets.

@bastienapp
Created September 27, 2018 08:37
Show Gist options
  • Select an option

  • Save bastienapp/2265a1adf9c127a3c3d9c8744b6c1957 to your computer and use it in GitHub Desktop.

Select an option

Save bastienapp/2265a1adf9c127a3c3d9c8744b6c1957 to your computer and use it in GitHub Desktop.
class MainActivity {
private int compteur = 5;
public void onCreate() {
Button event = findViewById(R.id.eventButton);
event.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// récupérer le nombre de point restant
if (isDead(compteur)) {
// Intent
}
}
}
}
public boolean isDead() {
compteur--;
if (compteur < 0) {
return true;
} else {
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment