Android Activity slow on 4.3 device

前端 未结 2 1867
死守一世寂寞
死守一世寂寞 2021-01-25 13:40

I developed an app that would stream videos from the web. I have an activity that lists the videos including their icons, titles and status (newly updated). For every row, there

相关标签:
2条回答
  • 2021-01-25 13:41

    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); }

    0 讨论(0)
  • 2021-01-25 13: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.

    enter image description here

    0 讨论(0)
提交回复
热议问题