0
由於無法識別自定義警報對話框中的佈局參數,我收到空指針異常,如何訪問「自定義警報對話框」的佈局參數...?
。
那麼,如果有人知道這個請幫助我...?
在此先感謝...!
builder = new AlertDialog.Builder(this);
builder.setView(getLayoutInflater().inflate(R.layout.custom_dialog, null));
//AlertDialog dialog = new AlertDialog.Builder(this).create();
//dialog.setContentView(R.layout.custom_dialog);
dialog = builder.create();
customDialogList = (ListView) dialog.findViewById(R.id.custom_list);
customDialogList.setAdapter(customDialogAdapter); // here null pointer exception
dialog.setCancelable(true);
dialog.show();
你的空指針指向你的代碼在哪裏? –
@ coder_For_Life22代碼已更新。 – Noby