HTC Sensation Real Resolution

后端 未结 2 1722
遇见更好的自我
遇见更好的自我 2020-12-06 16:05

I have two approaches to get real resolution:

    DisplayMetrics dm = new DisplayMetrics(); 
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    d         


        
相关标签:
2条回答
  • 2020-12-06 16:15

    I believe this is because your target or minimum SDK version is activating Screen Compatibility Mode. You should use higher minimum and target SDK values in your manifest.

    0 讨论(0)
  • 2020-12-06 16:23

    Conclusion about how to get real resolution:

    < uses-sdk android:targetSdkVersion="4"...
    
    < supports-screens android:anyDensity="true"...
    
    DisplayMetrics dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    String resolution = dm.widthPixels + "x" + m.heightPixels;
    
    0 讨论(0)
提交回复
热议问题