title: Android: ViewHolder pattern and different types of rows?
body: <p>ViewHolder pattern improves ListView scrolling framerate, as seen in following example:
  <a href="https://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html" rel="nofollow noreferrer">https://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html</a></p>
  
  <p>Is it possible to keep this pattern while using different kind of Views for different rows?</p>
  
  <p>In other words, is it possible to do something like:</p>
  
  <pre><code> 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);  
  </code></pre>