简体   繁体   中英

Check if android device has 'Draw over other app's' feature

I require the 'Draw over other apps' functionality to launch my activity from the background at a specific period. This works well on some devices, however I am testing it on a Samsung A01 device with Android 10 and the feature isn't available.

Is there a way I can check if the feature is available?

Actually I came to learn that the feature doesn't exists on Android Go devices.

Using the method isLowRamDevice() from ActivityManager, I was able to tell whether or not the device supports the feature.

How it works

ActivityManager activityManager = (ActivityManager) getContext().getSystemService(ACTIVITY_SERVICE);
boolean drawOverOtherAppsFeatureAvailable = activityManager.isLowRamDevice();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM