Mithun Sreedharan
Mithun Sreedharan

Reputation: 51282

Android title bar icon size

Is it possible to specify the size for the icon for the android title bar?

 requestWindowFeature(Window.FEATURE_LEFT_ICON);
 setContentView(R.layout.main);
 setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.logo);

Upvotes: 1

Views: 2061

Answers (1)

AlbeyAmakiir
AlbeyAmakiir

Reputation: 2247

If this question is about changing the size of an icon based on the resolution of the screen, you can make the image have multiple different sizes, name them all the same (for example, my_image.png), and put them in the appropriate res/drawable (default), res/drawable-hdpi (high dpi screens), etc. folders. Then you just request the image with:

Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.my_image);

which will return the appropriate image version for the screen.

Upvotes: 1

Related Questions