코드가 작동하지 않습니다. 도와주세요. 그것은 모든 문자열을 대체하지만 더 많은 코드가 실행되지 않습니다.안드로이드의 경고 상자가 작동하지 않습니다.
디버깅 할 때 코드에 오류가 없습니다. 경고 상자의 코드가 표시됩니다.
if(count>0)
{
System.out.println("replace all string name ");
// final Intent intent_ul=new Intent(this, UploadExcel.class);
AlertDialog.Builder alertDialogBuilder_ue = new AlertDialog.Builder(this);
alertDialogBuilder_ue.setTitle("Alert!!");
alertDialogBuilder_ue
.setMessage("Are you sure you want to Replace all the data related to this style ? ")
.setCancelable(false)
.setPositiveButton("Yes",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
mySQLiteAdapter.openToWrite();
mySQLiteAdapter.delete_style_measurement(style_no);
Log.d("","yes click");
count=0;
mySQLiteAdapter.close();
}
})
.setNegativeButton("No",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
Log.d("","No click");
count++;
dialog.cancel();
// startActivity(intent_ul);
//finish();
}
});
}
'에 AlertDialog에 AlertDialog = alertDialogBuilder_ue.create()에 대한 핸들이 필요하지 않을 경우
.create()
옵션을 사용이없는 ,'라인을? 'alertDialogBuilder_ue'는 무엇입니까 –alertDialogBuilder_ue는 alertdialog를 생성 할 수있는 빌더 객체입니다. 빌더 객체를 직접 사용하여 경고 대화 상자를 표시 할 수 없습니다. 먼저 AlerDialog의 인스턴스를 가져온 다음 show()를 호출해야합니다. –