Today in the Lietview sliding, encountered a very wonderful problem, in order to describe the problem, first on
The problem is this, when I swipe the right side of the sidebar, will call the Liestview SetSelection method, sliding to the corresponding position, but it is not conceivable that some of the names of the contacts disappeared, only the last name, and all the letters under the first contact, For example, under C Chai June, there will be only one "firewood" left. If I comment out this line of code, there is no sliding effect, and of course there is no exception.
Telephonylistview.setselection (position);
In order to further determine that this line of code caused, I changed a method test, the result is still an exception
Telephonylistview.scrollby (position);
To determine the cause of the problem, I opened the listview.class, but because there is no source code, or do not see the details of the method, Miss under the elder sister, the final consideration is not due to the convertview of the problem caused by the re-use, because before also encountered Convertview re-use caused problems, and finally abandoned con in adapter The problem has been solved by the practice of vertview reuse.
Thus, I judge in the source code, the ListView's swipe or call the adapter refresh method, and the refresh time also do some processing, so that external calls may appear when the exception, but what is the reason, to download a source to dig into ...
Content anomaly causes and solutions when the ListView is sliding