本文整理匯總了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();
}