final AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
try{
alertbox.setMessage(message);
alertbox.setTitle(title);
alertbox.setPositiveButton(ok,new DialogInterface.OnClickListener(){
public void onClick(DialogInterface arg0, int arg1){
}
});
alertbox.setNegativeButton(cancel,new DialogInterface.OnClickListener(){
public void onClick(DialogInterface arg0, int arg1){
}
});
alertbox.show();
}catch(Exception e){
//Handle BadTokenException.
}
}
私たちは(OKとキャンセル)AlertDialog以外の他の領域をクリックした場合、私はcancel.SoもOKをクリックして、いつでもAlertDialogを閉鎖したいと思い、それはいけないclose.It 2.xバージョンのAndroidでうまくいきます。しかし、Android 4.0では、okやcanc以外の空きスペースをクリックしてもダイアログが閉じていますどのように私はこれを克服することができます。
おかげ&よろしく、
ヴェンカト。