private ActivityManager am; am = (ActivityManager) getSystemService(ACTIVITY_SERVICE); MemoryInfo outInfo = new ActivityManager.MemoryInfo(); am.getMemoryInfo(outInfo); return outInfo.availMem;
返回的是 long 型的byte数据。
2022-02-04 13:47:17
private ActivityManager am; am = (ActivityManager) getSystemService(ACTIVITY_SERVICE); MemoryInfo outInfo = new ActivityManager.MemoryInfo(); am.getMemoryInfo(outInfo); return outInfo.availMem;
返回的是 long 型的byte数据。