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
我创建了一个包含我的手机所有联系人的Arraylist,我想将这个Arraylist放在警报对话框中。我该怎么做?请回复我
1 个解决方案
#1
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();
#1
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();