本文整理汇总了Java中android.app.ActivityManager.isLowRamDevice方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityManager.isLowRamDevice方法的具体用法?Java ActivityManager.isLowRamDevice怎么用?Java ActivityManager.isLowRamDevice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.ActivityManager
的用法示例。
在下文中一共展示了ActivityManager.isLowRamDevice方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLowMemoryDevice
import android.app.ActivityManager; //导入方法依赖的package包/类
private static boolean isLowMemoryDevice(ActivityManager activityManager) {
// Explicitly check with an if statement, on some devices both parts of boolean expressions
// can be evaluated even if we'd normally expect a short circuit.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return activityManager.isLowRamDevice();
} else {
return false;
}
}
示例2: isLowMemory
import android.app.ActivityManager; //导入方法依赖的package包/类
@TargetApi(VERSION_CODES.KITKAT)
public static boolean isLowMemory(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
return (VERSION.SDK_INT >= VERSION_CODES.KITKAT && activityManager.isLowRamDevice()) ||
activityManager.getMemoryClass() <= 64;
}
示例3: isLowMemoryDevice
import android.app.ActivityManager; //导入方法依赖的package包/类
private static boolean isLowMemoryDevice(ActivityManager activityManager) {
// Explicitly check with an if statement, on some devices both parts of boolean expressions
// can be evaluated even if we'd normally expect a short circuit.
//noinspection SimplifiableIfStatement
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return activityManager.isLowRamDevice();
} else {
return false;
}
}
示例4: isLowRamDevice
import android.app.ActivityManager; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
public static boolean isLowRamDevice(Context context) {
if(Utils.hasKitKat()){
final ActivityManager am = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
return am.isLowRamDevice();
}
return !hasMoreHeap();
}
示例5: isLowRamDevice
import android.app.ActivityManager; //导入方法依赖的package包/类
public static boolean isLowRamDevice(ActivityManager am) {
return am.isLowRamDevice();
}