Messagebox Android non mostra causa di finire chiamata, come fare questa funzione di attesa per ok e quindi chiudereAndroid Messagebox
public void msbox(String str,String str2)
{
AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);
dlgAlert.setMessage(str2);
dlgAlert.setTitle(str);
dlgAlert.setPositiveButton("OK", null);
dlgAlert.setCancelable(true);
dlgAlert.create().show();
finish();
}
dovrebbe essere come questo
public void msbox(String str,String str2)
{
AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);
dlgAlert.setTitle(str);
dlgAlert.setMessage(str2);
dlgAlert.setPositiveButton("OK",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
finish();
}
});
dlgAlert.setCancelable(true);
dlgAlert.create().show();
}
http://stackoverflow.com/questions/3782676/alertdialog-doesnt-wait-for-input –
Grazie per l'input. –
dovrei fornirglielo se lo hai usato così? –