RecyclerView data empty to display textview in fragment
<p>My json data is empty to visible the textview and hide the recyclerview.<br />
My xml code recyclerview and textview:<br /></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/common_padding"
&gt;

&lt;android.support.v7.widget.RecyclerView
    android:id="@+id/pending"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:scrollbars="vertical"
    /&gt;
&lt;TextView
    android:id="@+id/pendingnullorder"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Current no orders available"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
    android:textSize="@dimen/order_list_view_font_size"
    android:visibility="gone"
    /&gt;
</code></pre>

<p>
<br /><br />
My java code show textview &amp; hide recyclerview here:<br /></p>

<pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View drawer = inflater.inflate(R.layout.fragment_pending, container, false);

    pendingnullorder = (TextView) drawer.findViewById(R.id.pendingnullorder);

    recyclerView = (RecyclerView) drawer.findViewById(R.id.pending);
    progressBar = (ProgressBar) drawer.findViewById(R.id.progressBar);
    recyclerView.setVisibility(View.GONE);
    progressBar.setVisibility(ProgressBar.VISIBLE);

    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

    orderLists = new ArrayList&lt;&gt;();

    getProgressData();

    adapter = new OrderListAdapter(orderLists, getActivity());
    recyclerView.setAdapter(adapter);

    return recyclerView;
}
private void getProgressData(){
String token = SharedPreferencesManager.readPreferenceString("token", "D/N");
JSONObject progressData = new JSONObject();
try{
    progressData.put("token", token);
    JsonObjectRequest progressObject = new JsonObjectRequest(1, Common.OrderDetails + "progress", progressData, new Response.Listener&lt;JSONObject&gt;() {
        @Override
        public void onResponse(JSONObject progressResponse) {
            Log.d("Responseprogress", progressResponse.toString());
            try {
                int status = progressResponse.getInt("status");
                if(status == 1) {
                    progressOrderProgress(progressResponse);
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            error.printStackTrace();
            Log.d("Response", "PROGRESS ERROR");
        }
    });
    progressObject.setShouldCache(false);
    ServiceBellApp.getInstance().addToRequestQueue(progressObject);
}
catch (JSONException localJSONException){
    localJSONException.printStackTrace();
    return;
}}private void progressOrderProgress(JSONObject progressResponse) throws JSONException {
JSONArray result = progressResponse.getJSONArray("orderdata");
for(int i=0; i&lt;result.length(); i++){
    OrderList orderListModule = new OrderList();
    JSONObject orderData = null;
    try {
        orderData = result.getJSONObject(i);
        orderListModule.setPackage_name(orderData.getString("name"));
        orderListModule.setOrderdate(orderData.getString("date"));
        orderListModule.setServicedate(orderData.getString("service"));
        orderListModule.setServicetime(orderData.getString("time"));
        orderListModule.setOrderid(orderData.getString("id"));
        orderListModule.setOrdstatus(orderData.getString("status"));
        orderListModule.setOrderamount(orderData.getInt("ramount"));
    }catch (JSONException e) {
        e.printStackTrace();
    }
    orderLists.add(orderListModule);
}
swipeRefreshLayout.setRefreshing(false);
adapter.notifyDataSetChanged();}
</code></pre>

<p>It's possible to any one help me.I am new in android code.</p>