androidmobile-phones

getView method in android


I watched some videos but i did not understand why we use getView method in custom adopter in android. Can anyone explain that what does getView method do in array adopter. Thanks in advance.


Solution

  • Well you need to read and watch more But nothing help better than testing. getView() is getting view ;) Getting Each Item of Adapter to Access Each Elements. For example you create ListView and set Custom Adapter. and for each item in list you have some other child views. Image of People (ImageVIew) and Name (TextView) & etc. to access and modify each of these elements you call getView in Adapter Class. Take look and test this Example: Tutorial for Custom Adapter

    modify and destroy it to understand how it works. Good Luck