Reputation: 1
In my main-activity layout (RelativeLayout), I display three listviews of vertical orientation among other Buttons and Textviews. My problem is that when one of the listviews (the one on the left side of the screen) updates, the other two update too, causing poor UI performance.
I understand that RelativeLayout can be tricky in cases when the size of one view affects the positioning of the other (causing the other to redraw), so I have made sure that the positioning of the two listviews is not associated with the left listview's size.
I have also checked out tips on how to make listview redrawing more efficient, using ViewHolders etc, but I'd rather resolve this problem to it's core.
More details:
Upvotes: 0
Views: 257
Reputation: 2776
If you set android:layout_height="wrap_content"
to your ListView, then system try to find the best size of each elements and call getView many times. There is no way to around that other than using android:layout_height="fill_parent"
http://www.androiddevelopersolutions.com/2013/07/android-listview-adapter-getview-called.html custom listview adapter getView method being called multiple times, and in no coherent order
Upvotes: 1
Reputation: 1018
You are right RelativeLayout in the culprit, use some other view in plase of it, like LinearLayout with android:weightSum etc...
Upvotes: 1
Reputation: 39
Try to use same adapter class for the better performance because the execution time differs on what sort of data your are going to display.
Upvotes: 0