Reputation: 11201
I'm doing an AlertDialog, it has an image and a title:
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Recuerda tirar del cable");
builder.setIcon(context.getResources().getDrawable(R.drawable.tira_cable));
builder.setPositiveButton(R.string.accept, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//actions
}
});
AlertDialog dialog = builder.create();
dialog.show();
The title is not shown:
where is the title? I can't understand!
Upvotes: 2
Views: 3132
Reputation: 8747
I am not 100% sure if this will make a difference but I don't think the extra "noise", for lack of a better term is necessary in the .setIcon
. Try:
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Recuerda tirar del cable");
builder.setIcon(R.drawable.tira_cable);
builder.setPositiveButton(R.string.accept, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//actions
}
});
AlertDialog dialog = builder.create();
dialog.show();
Upvotes: 2