When getView() in ArrayAdapter is called

Adham picture Adham · Apr 15, 2012 · Viewed 15.1k times · Source

When creating a customized adapter for ListView in android, I see that I have to create a class the extends ArrayAdapter class and implements the getView(..) method.

All of that is OK, but I want to know the sequence of calling methods and executing. i.e. in which point of code the getView() is being called ?

Answer

Kri picture Kri · Apr 15, 2012

getView() of ArrayAdapter is called multiple times....

  1. as an when the new row is added...
  2. you scroll up and scroll down the list view....
  3. when the list is notfiedchanged..

Refer this link Android custom ArrayAdapter getView method called multiple times - resetting dynamic TextView value