Situation Description:
Today in the writing of data display, using the ListView, in its adapter, found that the number of times the GetView method execution is the data item n times (my side of the display is 4 times times, this times the value does not know will change), this is obviously unscientific!
Check the data and find the layout problem of the ListView. I set the android:layout_height= "wrap_content" Height to wrap_content. While the Wrap_content value makes the ListView not take the actual height, he also depends on the calculation to determine, and each time the calculation should trigger the ListView rendering, so the number of GetView calls will be more than the normal situation compared to several times.
Workaround:
In general, it is recommended to always set the height of Listiview in the layout file to: fill_parent (or Match_parent), which is not only the number of calls to GetView, but also the efficiency of the layout.
An issue in which the GetView method calls are greater than the number of data bars in the adapter Adapter of the Android listview