onCreateViewHolder not calling in fragmnet recyclerview
<p>I am using recyclerview in fragmnet.<br>
Fragmnet is working but my recycler view data not dispalyed.<br><br>
<strong>My xml code:</strong></p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"&gt;
&lt;android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="5dp"&gt;
    &lt;LinearLayout android:id="@+id/projectcommends" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/white" android:orientation="vertical" android:padding="@dimen/common_padding"&gt;
        &lt;TextView style="@style/TextHeading" android:text="Project comments" /&gt;
        &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="10dp"&gt;
            &lt;TextView android:layout_width="180dp" android:layout_height="wrap_content" android:text="Date" android:textSize="17dp" android:textColor="@color/black" android:gravity="center_horizontal" android:textStyle="bold" /&gt;
            &lt;TextView android:layout_width="180dp" android:layout_height="wrap_content" android:text="Comments" android:textSize="17dp" android:textColor="@color/black" android:gravity="center_horizontal" android:textStyle="bold" /&gt;
        &lt;/LinearLayout&gt;
        &lt;android.support.v7.widget.RecyclerView android:id="@+id/commendsList" android:layout_width="match_parent" android:layout_height="wrap_content" /&gt;
    &lt;/LinearLayout&gt;
&lt;/android.support.v7.widget.CardView&gt;
</code></pre>

<p></p>

<p><strong>Row xml:</strong></p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:layout_marginTop="5dp"&gt;
&lt;TextView android:id="@+id/commentdate" android:layout_width="180dp" android:textSize="15dp" android:layout_height="wrap_content" android:text="20-06-2016" android:gravity="center" /&gt;
&lt;TextView android:id="@+id/commentdetail" android:layout_width="180dp" android:layout_height="wrap_content" android:textSize="15dp" android:text="project commends testing list" android:gravity="center" /&gt;
</code></pre>

<p></p>

<p><strong>My Fragmnet code:</strong></p>

<pre><code>public class ProjectComments extends Fragment {
   private List &lt; CommentsData &gt; arraylist;
   private RecyclerView recyclerView;
   private RecyclerView.Adapter adapter;
   private RecyclerView.LayoutManager layoutManager;
   private String ordered;

   @Override
   public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View view = inflater.inflate(R.layout.project_comments, container, false);
      initialize(view);
      Bundle b = getArguments();
      orderid = b.getString("orderid");
      recyclerView.setHasFixedSize(true);
      recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
      arraylist = new ArrayList &lt; &gt; ();
      adapter = new CommentsAdapter(arraylist);
      recyclerView.setAdapter(adapter);
      getCommentsData();
      return view;
   }

   private void initialize(View view) {
      recyclerView = (RecyclerView) view.findViewById(R.id.commendsList);
   }

   private void getCommentsData() {
      String mobilecustomertoken = SharedPreferencesManager.readPreferenceString("MobileCustomerToken", "D/N");
      JSONObject commentData = new JSONObject();
      try {
         commentData.put("mobilecustomertoken", mobilecustomertoken);
         commentData.put("orderid", orderid);
         JsonObjectRequest commentsObject = new JsonObjectRequest(1, Common.CommentsList, commentData, new Response.Listener &lt; JSONObject &gt; () {
            @Override
            public void onResponse(JSONObject commentsResponse) {
               Log.d("Responsedetail", commentsResponse.toString());
               try {
                  int status = commentsResponse.getInt("status");
                  if (status == 1) {
                     commentsProgress(commentsResponse);
                  }
               } catch (JSONException e) {
                  e.printStackTrace();
               } catch (InterruptedException e) {
                  e.printStackTrace();
               }
            }
         }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
               error.printStackTrace();
               Log.d("Response", "PENDING ERROR");
            }
         });
         commentsObject.setShouldCache(false);
         ServiceBellApp.getInstance().addToRequestQueue(commentsObject);
      } catch (JSONException localJSONException) {
         localJSONException.printStackTrace();
         return;
      }
   }

   private void commentsProgress(JSONObject commentsResponse) throws JSONException, InterruptedException {
      JSONArray result = commentsResponse.getJSONArray("response");
      CommentsData orderListModule;
      for (int i = 0; i &lt; result.length(); i++) {
         JSONObject jsonObject = result.getJSONObject(i);
         orderListModule = new CommentsData();
         orderListModule.setCommentsData(jsonObject.getString("commentdate"));
         orderListModule.setCommentsDetail(jsonObject.getString("comendDetail"));
         arraylist.add(orderListModule);
      }
      adapter.notifyDataSetChanged();
      int count = adapter.getItemCount();
      if (count != 0) {
         Log.d("Response", "Test");
      }
   }
}
</code></pre>

<p><strong>Final my adapter code:</strong></p>

<pre><code>public class CommentsAdapter extends RecyclerView.Adapter &lt; CommentsAdapter.RecyclerViewHolder &gt; {
   List &lt; CommentsData &gt; arrayList;
   public CommentsAdapter(List &lt; CommentsData &gt; list) {
      this.arrayList = list;
   }

   @Override
   public RecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.comments_list, parent, false);
      RecyclerViewHolder recyclerViewHolder = new RecyclerViewHolder(view);
      return recyclerViewHolder;
   }

   @Override
   public void onBindViewHolder(RecyclerViewHolder holder, int position) {
      CommentsData commentsData = arrayList.get(position);
      Log.d("ResponseAdapter", commentsData.getCommentsData());
      holder.commentdate.setText(commentsData.getCommentsData());
      holder.commentDetail.setText(commentsData.getCommentsDetail());
   }

   @Override
   public int getItemCount() {
      String dd = Integer.toString(arrayList.size());Log.d("Responsecount", dd);return (null != arrayList ? arrayList.size() : 0);
   }

   public class RecyclerViewHolder extends RecyclerView.ViewHolder {
      public TextView commentdate, commentDetail;
      public RecyclerViewHolder(View itemView) {
         super(itemView);
         Log.d("ResponseAda", "Success");
         commentdate = (TextView) itemView.findViewById(R.id.commentdate);
         commentDetail = (TextView) itemView.findViewById(R.id.commentdetail);
      }
   }
}
</code></pre>

<p><strong>Edited:<br></strong></p>

<pre><code>@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.project_comments, container, false);
    initialize(view);
    Bundle b = getArguments();
    orderid = b.getString("orderid");
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new
            LinearLayoutManager(getActivity()));
    arraylist = new ArrayList &lt; &gt; ();
    getCommentsData();
    adapter = new CommentsAdapter(arraylist);
    recyclerView.setAdapter(adapter);
    return view;
}
</code></pre>

<p>Any one please help me why my onCreateViewHolder function not calling?</p>