Reputation: 90
I created a Arraylist containing all contacts of my mobile and I want to put this Arraylist inside the alert dialog.How can i do this?please reply me
Upvotes: 0
Views: 1040
Reputation: 126
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("Contacts");
builder.setMessage(your_arraylist.toString());
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
builder.show();
Upvotes: 1