I am trying to make a custom dialog with listview which is going to contain checkboxes and textviews and i just couldnt find a reasonable tutorial to do it , any help or hints w
private void showPopUp()
{
final AlertDialog.Builder helpBuilder = new AlertDialog.Builder(this);
helpBuilder.setTitle("");
LayoutInflater inflater = getLayoutInflater();
final View PopupLayout = inflater.inflate(R.layout.yourxml, null);
helpBuilder.setView(PopupLayout);
final AlertDialog helpDialog = helpBuilder.create();
helpDialog.show();
jobList = (ListView)PopupLayout.findViewById(R.id.list);
mylist = new ArrayList>();
for(int i=0;i();
map.put("name", arraylist.get(i));
mylist.add(map);
}
sd = new SimpleAdapter(activity.this,mylist,R.layout.jobslist,
new String[]{"name"},new int[]{R.id.jobText});
jobList.setAdapter(sd);
}
joblist.xml
you can call this showPopUp();
function wherever you want to display the alert dialog with listview. please note that there will be the arraylist which you can add items to it to show the items in a list