title: ListView Inside a RecyclerView
body: <p>I am creating a listview inside a Recyclerview. I am populating Recyclerview with data which is fetched online. The RecyclerView is populating properly. I want to populate the listview at the run time when a button will be clicked. I am defining onClickListener for the button and on button click I am getting the data and populating an adapter which will be set to the listview. But the data is not reflecting in the listview.</p>
  
  <p><a href="https://i.stack.imgur.com/CeU2i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CeU2i.png" alt="enter image description here"></a></p>
  
  <p>onClickListener for the Button</p>
  
  <pre><code> holder.arrow_up.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
                  new LoadClothes().execute(order.getOrderId());
          }
      });
  </code></pre>
  
  <p>Asynctask for Loading details for listview</p>
  
  <pre><code> private class LoadClothes extends AsyncTask&lt;String, Void, String&gt; {
  
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
      }
  
      @Override
      protected String doInBackground(String... strings) {
          String string = "";
          try {
              Request request = new Request.Builder()
                      .url(ORDERCLOTHES)
                      .addHeader("token", BaseApplication.getToken())
                      .addHeader("orderId", strings[0])
                      .build();
              Response response = client.newCall(request).execute();
              string = response.body().string();
              Logger.d(string);
          } catch (IOException e) {
              e.printStackTrace();
          }
          return string;
      }
  
      @Override
      protected void onPostExecute(String string) {
          super.onPostExecute(string);
  
          Logger.d(string);
  
          Gson gson = new Gson();
          Type type = new TypeToken&lt;List&lt;OrderedCloth&gt;&gt;() {
          }.getType();
          cloths = gson.fromJson(string, type);
          viewHolder.listView.setVisibility(ListView.VISIBLE);
          CustomListOrderAdapter adapter = new CustomListOrderAdapter(context, cloths);
          viewHolder.listView.setAdapter(adapter);
          adapter.notifyDataSetChanged();
      }
  }
  </code></pre>