title: RecyclerView.Adapter's onCreateViewHolder and onBindViewHolder methods are not getting called
body: <p>I'm trying to implement <a href="https://github.com/lucasr/twoway-view/" rel="nofollow">TwoWayView</a> in my project by following the sample project provided in that link. I have implemented everything and my code works without any errors but the actual List is not getting inflated. Upon debugging I found out that the adapter is set correctly and the <code>getItemCount</code> method is also returning positive count but the other two overridden methods <code>onCreateViewHolder</code> and <code>onBindViewHolder</code> are not getting called. I have no clue why it is not working. Please see the partial code below, any help is appreciated. Thanks.</p>
  
  <p><strong>MyAdapter.java</strong> class</p>
  
  <pre><code>public class MyAdapter extends RecyclerView.Adapter &lt; MyViewHolder &gt; {
  
      private MySimpleCursorAdapter mCursor;
      //some other private fields here
  
      public MyAdapter(Context context, Cursor c, int resourceId, ViewType viewType, String containerId) {
          mCursor = new MySimpleCursorAdapter(a1,a2,a3,a4,a5,a6); //Passed necessary arguments
          ....
      }
  
      @Override
      public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          Log.w("onCreateViewHolder", "---------&gt;executed"); //Line not executed
          final View view = mCursor.newView(mContext, mCursor.getCursor(), parent);
          return new MyViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(MyViewHolder holder, int position) {
          Log.w("onBindViewHolder", "---------&gt;executed"); //Line not executed
          mCursor.bindView(holder.itemView, mContext, mCursor.getCursor());
      }
  
      @Override
      public int getItemCount() {
          Log.w("count", Integer.toString(mCursor.getCount())); //This is executed
          return mCursor.getCount();
      }
  
      private class MySimpleCursorAdapter extends SimpleCursorAdapter {
  
          public MySimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) {
              super(context, layout, c, from, to, flags);
          }
  
          @Override
          public View newView(Context context, Cursor cursor, ViewGroup parent) {
              View view = mLayoutInflater.inflate(mLayoutToInflate, null);
              ....
              return view;
          }
  
          @Override
          public void bindView(final View view, Context context, Cursor cursor) {
              //Implemented this method for inflating all subviews inside each item of the list
          }
      }
   }
  </code></pre>
  
  <p><strong>Note:</strong> I have gone through similar questions but the answers provided there are not relevant to my question because my <code>RecyclerView</code> is not inside <code>ScrollView</code> and also the <code>getItemCount</code> is returning the positive count.</p>