我创建了一个包含移动设备所有联系人的Arraylist,我想把这个Arraylist放在警告对话框中。我该怎么做?请回复我
答案 0 :(得分: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();