samedi 7 février 2015

Android switching default density from 160 to 130


Vote count:

0




I tested my app on an Android x86 emulator (4.4-r_2).


This code is used to get the screen size:



WindowManager wm = (WindowManager)App.getAppContext().getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point size = new Point();
size.x = display.getWidth();
size.y = display.getHeight();
Log.v("", "sizeX: "+size.x+" sizeY: "+size.y);


The result is different for portrait and landscape orientation:


600x761: for portrait

800x561: for landscape


Also, background bitmaps in my Activity don't fill the whole screen. Sometimes I see this message in Logcat:



I/ActivityThread(6114): Switching default density from 160 to 130


How can I make bitmaps fill the whole screen if screen size is returned incorrectly?



asked 44 secs ago







Android switching default density from 160 to 130

Aucun commentaire:

Enregistrer un commentaire