Android: ViewHolder pattern and different types of rows?

Posted by tomash on Stack Overflow See other posts from Stack Overflow or by tomash
Published on 2010-01-17T16:02:28Z Indexed on 2010/06/03 12:14 UTC
Read the original article Hit count: 662

ViewHolder pattern improves ListView scrolling framerate, as seen in following example: http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html

Is it possible to keep this pattern while using different kind of Views for different rows?

In other words, is it possible to do something like:

 public View getView(int position, View view, ViewGroup parent) {  
     // calculate viewID here
     if (view == null || *view is not null but was created from different XML than viewID* ) { 
         view = mInflater.inflate(viewId, null);  

© Stack Overflow or respective owner

Related posts about android

Related posts about listview