is Low Memory - Android android.os

Android examples for android.os:Memory

Description

is Low Memory

Demo Code

import android.app.ActivityManager;
import android.content.Context;

public class Main {

  public static boolean isLowMemory(Context context) {

    if (context == null) {
      return false;
    }//from  w w  w  .j  a v  a 2s . co m
    ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    ActivityManager.MemoryInfo info = new ActivityManager.MemoryInfo();
    activityManager.getMemoryInfo(info);
    return info.lowMemory;
  }

}

Related Tutorials