1) Call Appscustomizetabhost's Ontrimmemory () method in Launcher's OnStop method, and call the System.GC () method.
2) Increase the call appscustomizepagedview.clearallapppages () in the Appscustomizetabhost ontrimmemory () method;
3) in Appscustomizepagedview.java, add the Clearallapppages () method, which removes the app page and sets it to dirty.
Called in the OnStop method of launcher:
Activitymanager Activitymanager = (activitymanager) getsystemservice (Context.activity_service);
if (!getpackagename (). Equals (Activitymanager.getrunningtasks (1). Get (0). Topactivity.getpackagename ())) {
Final Windowmanagerglobal WindowManager = Windowmanagerglobal.getinstance ();
Windowmanager.starttrimmemory (Componentcallbacks2.trim_memory_complete);
Windowmanager.endtrimmemory ();
Mappscustomizetabhost.ontrimmemory ();
Mwidgetscustomizeview.ontrimmemory ();
}
The level parameter is recommended for Componentcallback2.trim_memory_ui_hidden,
If this does not work, modify the other values for the Componentcallback2.java test,
such as Componentcallback2.trim_memory_complete, then pick a suitable value from it.
Android 1080P launcher consumes more than 300M of RAM after a certain period of time