This is done several times because each view is displayed, it measures the height of the view, executes the measure method, and causes the GetView to execute multiple times.
The workaround is to add the ListView
Layout_width is set to Fill_parent,
<ListViewAndroid:id= "@+id/lv_messages"Android:layout_width= "Fill_parent"Android:layout_height= "Fill_parent"Android:layout_alignparentleft= "true"Android:layout_below= "@+id/linearlayout1"Android:cachecolorhint= "#0000"Android:divider= "#0000"Android:dividerheight= "2DP"Android:listselector= "#0000" > </ListView>
The width and height are set to Fill_parent, if the ListView has a parent layout, the width and height of the parent layout are set to Fill_parent, which successfully resolves the problem that the custom adapter GetView performed multiple times.
The ListView Adapter GetView in Android has been called the problem resolution multiple times