Android 1080P launcher consumes more than 300M of RAM over a period of time

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.