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
| /** initialisation de l'alertDialog pour le resumé **/
LayoutInflater factory = LayoutInflater.from(getApplicationContext());
final View alertDialogView = factory.inflate(R.layout.alert_dialog_resume, null);
final AlertDialog.Builder adb = new AlertDialog.Builder(getApplicationContext());
adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
EditText et = (EditText)alertDialogView.findViewById(R.id.resumeManuel);
resumeManuel = et.getText().toString();
} });
adb.setNegativeButton("Annuler", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
radioResumeAutomatique.setChecked(true);
} });
/** modification lors du changement de choix pour le résumé **/
radioChoixResume.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup group, int checkedId) {
RadioButton rEnCours=(RadioButton)findViewById(checkedId);
if (rEnCours.getId()==R.id.radioManuel){
adb.setView(alertDialogView);
adb.setTitle("Ajouter un résumé");
adb.show();
}
if (rEnCours.getId()==R.id.radioAutomatique){
}
}
}); |
Partager