title: How to show recently added items first in recyclerview
body: <p>I'm creating an app similar to the instagram app but only admin can add contents. i used python django for my backend but when i add new item to my django database, it comes last on the recyclerview. I want it to be in a way that, when i add new item, it comes first when you open my app like the way instagram shows recent items first.
   This is my custom Adapter class</p>
  
  <pre><code>public class DealAdapter extends RecyclerView.Adapter&lt;DealAdapter.DealHolder&gt; {
  
  Context context;
  ArrayList&lt;Deal&gt; arrayList;
  
  
  public DealAdapter(Context context,  ArrayList&lt;Deal&gt; arrayList) {
      this.context = context;
      this.arrayList = arrayList;
  }
  
  @Override
  public DealHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      LayoutInflater inflater = LayoutInflater.from(context);
      View v = inflater.inflate(R.layout.deal_cardview, parent, false);
      DealHolder dealHolder = new DealHolder(v);
      return dealHolder;
  }
  
  @Override
  public void onBindViewHolder(DealHolder holder, int position) {
      Deal deal = arrayList.get(position);
      holder.title.setText(deal.getTitle());
      Picasso.with(context).
              load(deal.getImage()).
              placeholder(R.drawable.loading).
              error(android.R.drawable.stat_notify_error).
              into(holder.image);
  
  }
  
  @Override
  public int getItemCount() {
      if(arrayList != null) {
          return arrayList.size();
      }else {
          return 0;
      }
  }
  
  
  public class DealHolder extends RecyclerView.ViewHolder {
     TextView title;
     ImageView image;
  
     public DealHolder(View itemView) {
         super(itemView);
         title = (TextView) itemView.findViewById(R.id.tvTitle);
         image = (ImageView) itemView.findViewById(R.id.ivImage);
     }
   }
  }
  </code></pre>
  
  <p>This is my main Activity class</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  RecyclerView recyclerView;
  String TAG = "MainActivity";
  ImageButton ibMore;
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      recyclerView = (RecyclerView) findViewById(R.id.rvRecyclerview);
      LinearLayoutManager layoutManager = new LinearLayoutManager(this);
      recyclerView.setLayoutManager(layoutManager);
  
      String url = "http://192.168.43.2/api/deals/?format=json";
      StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      ArrayList&lt;Deal&gt; userList = new JsonConverter&lt;Deal&gt;().
                              toArrayList(response, Deal.class);
                      DealAdapter adapter = new DealAdapter(getApplicationContext(), userList);
                      recyclerView.setAdapter(adapter);
  
                  }
              },
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      Log.d(TAG, error.toString());
                      Toast.makeText(getApplicationContext(), "Something Went wrong: " + "'" + error + "'", Toast.LENGTH_LONG).show();
  
                  }
              });
  
      MySingleton.getInstance(getApplicationContext()).addToRequestQueue(stringRequest);
  
    }
  }
  </code></pre>