I want to display a custom dialog that have a listview inside it. First take a look on my code below.
Dialog:
protected void onPostExecute(String file_ur
When you get the ListView yet not set te layout in the Dialog. You need build first your dialog and after get the ListView
Check this:
protected void onPostExecute(String file_url) {
btnInvite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
LayoutInflater inflater = getActivity().getLayoutInflater();
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setView(inflater.inflate(R.layout.dialog_add, null))
.setTitle("Invite people")
.setNegativeButton("Cancel", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
dialog.cancel();
}
});
Dialog dialog = builder.create();
ListView lv = (ListView) dialog.findViewById(R.id.lvAddDialog);
ListviewContactAdapter adapter = new ListviewContactAdapter(getActivity(), listContact);
lv.setAdapter(adapter);
dialog.show();
}
});
}
}