ActivityManager.MemoryInfo 小问题

============问题描述============


小菜一个,请教一下函数提示说 totalMem 
totalMem cannot be resolved or is not a field
可能怀疑我用的sdk是旧的,我在google 文档看到的这个成员函数是在sdk18版本上看的

    public long getTotalAvaile()

    {

    	long memTotal;

    	ActivityManager am=(ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);

    	ActivityManager.MemoryInfo mi=new ActivityManager.MemoryInfo();

    	//MemoryInfo

    	am.getMemoryInfo(mi);

    	memTotal=mi.totalMem();

    	

    	return memTotal;

    }

============解决方案1============


totalMem是个域,不是方法,改成这样:
memTotal=mi.totalMem;
posted @ 2014-10-19 21:57  android开发教程2015  阅读(227)  评论(0编辑  收藏  举报
我要啦免费统计