获取最大运行内存
Runtime rt = Runtime.getRuntime();
long maxMemory = rt.maxMemory();
Log.i("maxMemory:", Long.toString(maxMemory / (1024 * 1024)));
使用最大内存
<!--android:largeHeap="true" 可以使用最大内存-->
<application
android:name=".app.MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:largeHeap="true"
>
本文介绍如何在Java中获取应用程序的最大可用内存,并通过设置属性android:largeHeap为true来允许应用使用更多的内存资源。
4141

被折叠的 条评论
为什么被折叠?



