有什么方法可以检测到该设备正在运行 Android Go 版本?需要确定设备是否能够提供 SYSTEM_ALERT_WINDOW
从 API 29 开始。
根据引用,Settings.canDrawOverlays(Context context)
在 API 29 Go 上将始终返回 false。不知道系统是否可以访问 SYSTEM_ALERT_WINDOW
很难解决这个问题。
最佳答案
ActivityManager am = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE);
am.isLowRamDevice();
ActivityManager.java
中提供以下代码 /**
* Returns true if this is a low-RAM device. Exactly whether a device is low-RAM
* is ultimately up to the device configuration, but currently it generally means
* something with 1GB or less of RAM. This is mostly intended to be used by apps
* to determine whether they should turn off certain features that require more RAM.
*/
public boolean isLowRamDevice() {
return isLowRamDeviceStatic();
}
关于android - 如何检测 Android Go?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58340558/