title: android - bindView and newView for two view layout in CursorAdapter
body: <p>So here's the story:</p>
  
  <p>I want to use two layouts in my adapter.  So basically, I need to have an if in the newView() to determine which view to return and and an if in bindView() to know as well what to do in the view.  Is this the right approach?</p>
  
  <p>I'm thinking of something like this:</p>
  
  <pre><code>@Override
  public View newView(Context context, Cursor c,
          ViewGroup parent) {     
      if (HEADER == getItemViewType(c.getPosition())){
          return (View) layoutInflater.inflate(R.layout.my_header, null);
      } else {
          return (View) layoutInflater.inflate(R.layout.my_row, null);
      }
  }
  </code></pre>
  
  <p>Then on bindView:</p>
  
  <pre><code>@Override
  public void bindView(final View view, final Context context,
          Cursor c) {     
      if (TYPE_HEADER == getItemViewType(c.getPosition())){
          // init and set values here e.g. view.findViewById().setText()
      } else {
          // init and set values here e.g. view.findViewById().setText()
      }
  }
  </code></pre>
  
  <p>Am I on the right track here? Because according to my logs, the c.getPosition() in newView gives different result on c.getPosition() in bindView.  I'm actually thinking of just overriding the getView() but they said good practice is overriding newView and bindView in CursorAdapter.</p>