问题
I've a 7 inch tablet but Android select the normal/
resource folder, and it's wrong for me.
I found that I can get the diagonal with some calculations:
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
double x = Math.pow(dm.widthPixels / dm.xdpi, 2);
double y = Math.pow(dm.heightPixels / dm.ydpi, 2);
double screenInches = Math.sqrt(x + y);
Log.d("debug", "Screen inches : " + screenInches);
When choosing the resource folder, what Android does?
- Make this kind of calculation or
- get screen size from build.prop?
来源:https://stackoverflow.com/questions/18106854/how-does-android-choose-which-small-normal-large-resource-folder