Question

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!

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top