If the showChatList()
function is not being called in the code, and the dialog is displayed normally.
When the listView
is called via showChatList()
function, it does not work.
To the original custom dialog
Is it impossible to bring up the listView?
public void callFunction() {
final Dialog dlg = new Dialog(context);
dlg.setContentView(R.layout.room_list);
dlg.show();
final Button okButton = (Button) dlg.findViewById(R.id.okButton);
final Button backbtn = (Button) dlg.findViewById(R.id.backbtn);
**final ListView chat_list = (ListView) dlg.findViewById(R.di.chat_list);**
- or
**chat_list = dlg.findViewById(R.id.chat_list);**
backbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dlg.dismiss();
}
});
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dlg.dismiss();
}
});
showChatList();
}