HAxxor
HAxxor

Reputation: 1174

Why is my ListView laggy on newer devices, but fast on older devices?

So I am doing the typical listview viewholder pattern. I am also setting images in a background thread and disabling loading images if the user flings the list.

On older devices (Galaxy s, htc desire, Original Google nexus) my listview works perfectly, no lag at all, even when i scroll/fling the listview. However, on my newer devices (Galaxy S3, Nexus) it is super laggy.

I am performing quite a bit of if/else conditions to setvisibility on certain views. Can this be the root cause? If so why would it be only affecting newer devices?

Upvotes: 5

Views: 155

Answers (1)

satur9nine
satur9nine

Reputation: 15072

Hard to say without seeing your code. Try hooking the device up to adb, open DDMS and press the method profiling button (icon with 3 arrows and a red dot), then start scrolling a bunch for a few seconds in your app. Press the stop profiling button (same button) and Traceview will open and you see what is using up all the CPU time.

Upvotes: 1

Related Questions