Supporting Multiple Screens Using Drawables Different Density

Standard

Android supports several configuration qualifiers that allow you to control how the system selects your alternative resources based on the characteristics of the current device screen. A configuration qualifier is a string that you can append to a resource directory in your Android project and specifies the configuration for which the resources inside are designed.

setCompoundDrawables() doesn’t display the Button Drawable

Standard

Image is blank because it hasn’t got specified bounds. You may use setCompoundDrawables() but before you should specify image’s bounds, using Drawable.setBounds() method:

Drawable d = getResources().getDrawable(R.drawable.ic_action_selector);
d.setBounds(0, 0, 128, 128);
btnRegistery.setCompoundDrawables(null, d, null, null);

How to add Icon to your Website?

Standard

Simply by adding a link tag you can have your own icon to a website. just make sure that you used full address of icon file.

for example:

<link rel="shortcut icon" href="http://www.nevisan.com/images/nevisan_icon.ico" />

all browsers support this tag.

you can also use a png file as your website icon but IE does not support it. then you have to add more than one link tag:

1st:

<link rel="shortcut icon" href="http://www.nevisan.com/images/nevisan_icon.ico" />

2nd:

<link rel="icon" type="image/png" href="http://www.nevisan.com/images/nevisan_icon24.png" />

IE uses the 1st tag and show the icon file, and other browsers like FireFox or Chrome use the 2nd one, and show the PNG file. just don’t change the order.

another point is that to see the changes of Icons you have to use Ctrl+F5 in IE, because the old icon is cached.

  • my biggest problem is that I can’t stop using png files… ;)