Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What size should the icon in an alertdialog be?

I am trying to assign an icon to an alertdialog but keep getting a memory error (seems to be from the size of the icon).

What size should the icon be for an alertdialog?

like image 979
Kurt Avatar asked Jan 02 '13 00:01

Kurt


People also ask

How do I make alert dialog fill 90% of screen size?

Builder adb = new AlertDialog. Builder(this); Dialog d = adb. setView(new View(this)). create(); // (That new View is just there to have something inside the dialog that can grow big enough to cover the whole screen.)

How do I add icons to alert dialog?

You can add an icon with the following code: Dialog dialog = new Dialog(context); dialog. requestWindowFeature(Window. FEATURE_LEFT_ICON); dialog.

How many buttons can be set up on an AlertDialog?

AlertDialog. A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout.

What is the difference between dialog and AlertDialog?

AlertDialog is a lightweight version of a Dialog. This is supposed to deal with INFORMATIVE matters only, That's the reason why complex interactions with the user are limited. Dialog on the other hand is able to do even more complex things .


2 Answers

32x32 at mdpi. See here. Very easy to google.

like image 155
323go Avatar answered Oct 10 '22 22:10

323go


Most Internet results will lead you that HDPI is the max icon you need. This is WRONG.

Just tested as a part of the current project and this is what get you the best result:

LDPI 24px
MDPI 32px
HDPI 48px
XHDPI 64px
XXHDPI 96px
XXXHDPI 128px

like image 31
sandalone Avatar answered Oct 10 '22 22:10

sandalone