Я использую AlertDialog (см. ниже код) и хотел бы поместить изображение перед каждым текстом.
Например, значок электронной почты, затем текст "Электронная почта", значок Facebook, затем текст "Facebook" и т.д.
Используя следующий код, как добавить значок перед каждым текстовым значением?
final CharSequence[] items = { "Email", "Facebook", "Twitter", "LinkedIn" };
AlertDialog.Builder builder = new AlertDialog.Builder(More.this);
builder.setTitle("Share Appliction");
builder.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) {
if (item == 0) {
} else if (item == 1) {
} else if (item == 2) {
} else if(item == 3) {
}
}
});
AlertDialog alert = builder.create();
alert.show();