mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-20 21:40:15 -07:00
Manual RAM allocator
This commit is contained in:
parent
665de1767d
commit
b7220184ab
7 changed files with 46 additions and 16 deletions
|
|
@ -70,6 +70,22 @@ public final class Tools
|
|||
public static final String LIBNAME_OPTIFINE = "optifine:OptiFine";
|
||||
|
||||
public static void launchMinecraft(final LoggableActivity ctx, MinecraftAccount profile, String versionName) throws Throwable {
|
||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||
((ActivityManager)ctx.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryInfo(mi);
|
||||
if(LauncherPreferences.PREF_RAM_ALLOCATION > (mi.availMem/1048576L)) {
|
||||
ctx.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
androidx.appcompat.app.AlertDialog.Builder b = new androidx.appcompat.app.AlertDialog.Builder(ctx)
|
||||
.setMessage(ctx.getString(R.string.memory_warning_msg,(mi.availMem/1048576L),LauncherPreferences.PREF_RAM_ALLOCATION))
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {}
|
||||
});
|
||||
b.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
JMinecraftVersionList.Version versionInfo = Tools.getVersionInfo(null,versionName);
|
||||
PerVersionConfig.update();
|
||||
PerVersionConfig.VersionConfig pvcConfig = PerVersionConfig.configMap.get(versionName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue