the variable convertView in getView of BaseAdapter . What is it for? when creating items should I always use convertView? What is the problem if I don't use it?
Asked
Active
Viewed 53 times
0
-
1Go through this link http://stackoverflow.com/questions/10560624/what-is-the-purpose-of-convertview-in-listview-adapter – Anshuman Borah Nov 09 '15 at 09:01
-
that helped . thanks – JITHIN GOPAL Nov 10 '15 at 04:39
1 Answers
1
What is it for?
it an instance of the View
if you inflate, the first time its value is null. E.g.
if (convertView == null) {
convertView = inflate...
}
when creating items should I always use convertView?
yes, but try to implement the ViewHolder pattern around it. It will speed up the scroll's performance.
What is the problem if I don't use it?
it depends on the the number of items you have in your ListView
. We can go from laggy ux to crashes.

Blackbelt
- 156,034
- 29
- 297
- 305