title: RecyclerView duplicates every item
body: <p>I have a problem dealing with recyclerview, when i return back to the activity after opening another activity, it duplicates all the items i displayed. Is there any way to fix this? </p>
  
  <p>Like on list view, it just automatically clears the list and then display it again. can you show me how? thanks</p>
  
  <blockquote>
    <p>OnCreate</p>
  </blockquote>
  
  <pre><code>int x = 0;
                  for(String Name : property_name){
                      JSONObject jsonObject = arrayResponse.getJSONObject(x);
                      property_id[x] = jsonObject.getString("property_id");
                      property_name[x] = jsonObject.getString("property_name");
                      type[x] = jsonObject.getString("property_type");
                      price[x] = jsonObject.getString("price");
                      address[x] = jsonObject.getString("address");
  
                      ListingNearby listingNearby = new ListingNearby(property_id[x], property_name[x], type[x], price[x], Math.round(distance[x]));
                      x++;
                      list.add(listingNearby);
  
                  }
  
                  recyclerView = (RecyclerView) findViewById(R.id.ln_recycler_view);
                  layoutManager = new LinearLayoutManager(this);
                  recyclerView.setLayoutManager(layoutManager);
                  recyclerView.setHasFixedSize(true);
                  adapter = new ListingNearbyAdapter(list);
                  recyclerView.setAdapter(adapter);
  </code></pre>
  
  <p>I wonder what to put in onResume so that the listview clears the list and then display it again.</p>