android - 如何获得通用屏幕尺寸?

标签 android

http://developer.android.com/guide/practices/screens_support.html状态:

Terms and concepts

Screen size Actual physical size, measured as the screen's diagonal. For simplicity, Android groups all actual screen sizes into four generalized sizes: small, normal, large, and extra large.

如何以编程方式获取设备屏幕的通用尺寸?我正在寻找的方法或属性将返回以下之一:small、normal、large 和 extra large。 (或可以映射到那些的常量/枚举)

谢谢。

-mz

最佳答案

使用screenLayoutConfiguration 对象中。

关于android - 如何获得通用屏幕尺寸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5998264/

相关文章:

android - 带有 AppCompat 主题的日期选择器对话框

android - 服务中的位置查找器被信号量阻止?

android - Play 商店中的促销图片和特色图片有什么区别

java - Android 上 GeoPoint 的空指针异常

java - rxjava2 中的运算符延迟

java - JsonSyntaxException - 预期为 BEGIN_OBJECT,但实际为 BEGIN_ARRAY

Android 无法将 FAB 按钮锚定到 BottomSheet

java - 使用java代码以编程方式创建android应用程序

android - 缺少 Kotlin View setEnabled 函数?

android - 使用 SimpleCursorAdapter.ViewBinder 改变 TextView 的颜色