KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am using an AlertDialog (see the below code) and would like to put an image before each text. For example, email icon then text "Email", Facebook icon then text "Facebook", etc. Using the following code, how to add an icon before each text value? 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();
Tags (comma-separated)
Save Edits
Cancel