1

this is how my app should look like:

enter image description here

But this is how it looks like on a Galaxy S4 (running stock Android 4.2.2)

enter image description here

The images are displayed much smaller than expected. It seems that the problem is similar to this one: XML Layout on Sony Smartwatch but I've already put my image files in the res/drawable-nodpi folder, as advised.

I'm loading the drawables like this:

phoneTypeMobile = BitmapFactory.decodeResource(r, R.drawable.type_mobile);

And displaying them on the screen:

canvas.drawBitmap(phoneTypeMobile, 2, height - 20, null);

What could be the reason for this problem? Thanks for any advise!

Community
  • 1
  • 1
Eir
  • 1,003
  • 9
  • 24
  • 1
    Use the image button while editing question. Save people following links. The links also don't work. – weston Sep 04 '13 at 06:03

1 Answers1

0

Can't see your images, but I know what you mean.

Force a density while decoding:

Options options = new Options();
options.inDensity = DisplayMetrics.DENSITY_DEFAULT;
options.inScaled = false;
phoneTypeMobile = BitmapFactory.decodeResource(resources,
                                               R.drawable.type_mobile,
                                               options);
weston
  • 54,145
  • 21
  • 145
  • 203
  • Yes, that's the way, I thought I did accept the answer immediately, sorry for being late. – Eir Oct 29 '13 at 18:09