How does Android choose which small/normal/large resource folder?

房东的猫 提交于 2019-12-25 01:44:33

问题


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?

  1. Make this kind of calculation or
  2. get screen size from build.prop?

来源:https://stackoverflow.com/questions/18106854/how-does-android-choose-which-small-normal-large-resource-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!