public long getAvailMemory() { //RAM内存大小
//(ActivityManager)mContext.getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager am =(ActivityManager)getSystemService(ACTIVITY_SERVICE);
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
am.getMemoryInfo(mi);
return mi.availMem;
}
private void showMemory() {
// 1.Internal Memory
// ActivityManager.MemoryInfo
ActivityManager actMgr = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memoryInfo = newActivityManager.MemoryInfo();
actMgr.getMemoryInfo(memoryInfo);//获取内存信息
Log.e("TAG","availMem=" + (memoryInfo.availMem >> 20) + "M")