Android Activity slow on 4.3 device

♀尐吖头ヾ 提交于 2019-12-02 02:48:59

Try to start method profiling (see picture), then launch your activity, then stop method profiling by hitting the same button in the picture again. Eclipse will generate a report where you will see which method takes what time to execute. Thus you can find out which method caused the delay.

I noticed performance issues on the HTC one when going from 4.1 to 4.3 or 4.2. Disabling hardware acceleration actually improved performance on many pages when using the HTC One. You can try disabling hardware acceleration in your manifest and then enabling it for all devices but the HTC one in your main activities.

Other devices had great performance for the same pages with hardware acceleration enabled. It's only the HTC one that struggled and needed the below code:

if(!(android.os.Build.MODEL.equalsIgnoreCase("HTC One") && Integer.parseInt(android.os.Build.VERSION.SDK) == 18)) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); }

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!