This question already has an answer here:
- Call random methods in Android 3 answers
I'm developing an app, and for some reason, I want to pick one public void method randomly at a time on button click, please help me to write the code. Thank you!
Button b;
Random r;
b.setOnClickListener() {
// pick one public void at a time randomly
// choose either A, B, C, D, E
}
public void A () {
// codes for a
}
public void B () {
// codes for b
}
public void C () {
// codes for c
}
public void D () {
// codes for d
}
public void E () {
// codes for e
}
Aucun commentaire:
Enregistrer un commentaire