is Low Memory - Android Hardware

Android examples for Hardware:Memory

Description

is Low Memory

Demo Code


//package com.java2s;
import android.app.ActivityManager;
import android.app.ActivityManager.MemoryInfo;
import android.content.Context;

public class Main {

    public synchronized static boolean isLowMemory(Context context) {

        MemoryInfo memoryInfo = new MemoryInfo();
        ActivityManager activityManager = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);
        activityManager.getMemoryInfo(memoryInfo);

        return memoryInfo.lowMemory;
    }/*from  ww  w  . ja  v a 2  s  .  co m*/
}

Related Tutorials