获取系统可用内存

private String getAvailMemory( ){  
    ActivityManager am = (ActivityManager) getSystemService( Context.ACTIVITY_SERVICE );  
    MemoryInfo mi = new MemoryInfo( );  
    am.getMemoryInfo( mi );  
    return Formatter.formatFileSize( context, mi.availMem );  

你可能感兴趣的:(内存)