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
| static AlertDialog dlg;
public static void showSystem() {
final AlertDialog.Builder infoSys = new AlertDialog.Builder(context);
infoSys.setTitle("Réglages système");
LinearLayout fntrPrinc = new LinearLayout(context);
fntrPrinc.setOrientation(1);
LinearLayout fntrSec03 = new LinearLayout(context);
fntrSec03.setOrientation(0);
TextView prm3 = new TextView(context);
prm3.setText(" Durée à éclairage max");
final EditText edPrm3 = new EditText(context);
edPrm3.setInputType(InputType.TYPE_CLASS_NUMBER|InputType.TYPE_NUMBER_FLAG_SIGNED );
edPrm3.setText(String.valueOf(INIT.prefsGPS.tMaxLumAff));
edPrm3.setHint("minutes");
fntrSec03.addView(prm3);
fntrSec03.addView(edPrm3);
fntrPrinc.addView(fntrSec03);
infoSys.setView(fntrPrinc);
infoSys.setPositiveButton("Valider", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if ("Ça me convient, on ferme le Dialogue")
// Faire ce qu'il faut , puis le dialogue va se fermer
else
// Je voudrais que le dialogue reste ouvert pour modifier ce qui n'allait pas
}
});
infoSys.setNeutralButton("Rien", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
infoSys.setNegativeButton("Annuler", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
dlg = infoSys.create();
dlg.show();
} |
Partager