1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| public class Menu_Quiz extends Activity {
int NbQuestions;
EditText nbreQuestion;
Button quiz;
Button quit;
private String sNombre;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(layout.main_menu);
nbreQuestion = (EditText)findViewById(id.et_questNbre);
quiz = (Button)findViewById(id.btn_quiz);
quiz.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
NbQuestions = Integer.parseInt(nbreQuestion.getText().toString());
// int nbreQuestion.getInputType();
// int NbQuestions = nbreQuestion.getInputType();
Intent actibis = new Intent(Menu_Quiz.this, MainActivity.class);
actibis.putExtra("info", NbQuestions);
// Bundle pass1 = new Bundle();
// pass1.putInt("passInfo1", NbQuestions);
// actibis.putExtras(pass1);
startActivity(actibis);
quit = (Button)findViewById(id.btn_quitter);
quit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
});
}} |