code: public static boolean isLowOnMemory(Context context) {
          ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
          ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
          activityManager.getMemoryInfo(mi);
          return mi.lowMemory;
      }
docs: <p>Checks the current device's {@link ActivityManager} system service and returns the value
  of the lowMemory flag.</p>
  
  @return <p>A {@link Boolean} value representing the low memory flag of the current device.</p>
  <ul>
  <li><i>true</i> - the free memory on the current device is below the system-defined threshold
  that triggers the low memory flag.</li>
  <li><i>false</i> - the device has plenty of free memory.</li>
  </ul>