title: How to set Custom listview According to the itemname alphabetically?
body: <p>This is the method where i am getting the data from the server and show in the <code>listview</code></p>
  
  <p>I want to show the list alphabetically accordingly to the i am setting the name with the help of model class.   <code>pojoRestaurant.setRestroName(jsonObject.getString("RestaurantName"));</code></p>
  
  <p>I want to show the list accordingly RestaurantName.can anyone tell me how can i do this ??</p>
  
  <pre><code>public void requestRestaurantSearchByFilter_list() {
  
  mProgressDialog.show();
  StringRequest restrolistrequestfilter = new StringRequest(Request.Method.POST, GlobalData.SEARCHBYFILTERURL,
          new Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String response) {
                  try {
                      mProgressDialog.dismiss();
                      mPaymentMethodList.clear();
                      mDataList.clear();
                      mAllList.clear();
                      mAdapter.notifyDataSetChanged();
  
                      Log.e("responcefilterlist....", response);
  
                      JSONObject jObject = new JSONObject(response);
                      if (jObject.getString("status").equals("1")) {
  
                          JSONArray jsonArray = jObject.getJSONArray("data");
                          for (int i = 0; i &lt; jsonArray.length(); i++) {
  
                              JSONObject jsonObject = jsonArray.getJSONObject(i);
                              PojoRestaurant pojoRestaurant = new PojoRestaurant();
  
                              pojoRestaurant.setRestroName(jsonObject.getString("RestaurantName"));
                              pojoRestaurant.setDeliveryTime(jsonObject.optString("DeliveryTime"));
                              pojoRestaurant.setPaymentOption(jsonObject.getString("PaymentOptions"));
                              pojoRestaurant.setMinimumOrder(jsonObject.getString("MinimumOrder"));
  
                              if (jsonObject.getString("ImageUrl").equals("") || jsonObject.getString("ImageUrl") == "null") {
  
  
                              } else {
                                  pojoRestaurant.setRestroImage(jsonObject.getString("ImageUrl"));
                              }
  
                              id = jsonObject.getString("ID");
                              mPaymentMethodList.add(jsonObject.getString("PaymentOptions"));
  
                              getpaymentId.add(id);
                              getListViewId.add(id);
  
                              if (jsonObject.getString("OpenStatus").equals("true")) {
                                  pojoRestaurant.setOpenClose("Open");
                              } else {
                                  pojoRestaurant.setOpenClose("Close");
                              }
  
                              mAllList.add(pojoRestaurant);
                              mDataList.add(pojoRestaurant);
                              //mDeliveryList.add(jsonObject.getString("DeliveryTime"));
                              // mCuisineTypeList.add(jsonObject.getString("RestaurantName"));
                          }
  
                          mListView.setAdapter(mAdapter);
                          mAdapter.notifyDataSetChanged();
                      } else {
  
                      }
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
          },
          new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError volleyError) {
  
                  Log.e("error", "" + volleyError.getMessage());
                  if (volleyError.getMessage() == null)
                      requestRestaurantSearchByFilter_list();
              }
          }) {
  
  
      @Override
      protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
  
          Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
  
          String foodid = getArguments().getString("FOODID");
          String areaid = getArguments().getString("AREAID");
  
          Log.e("foodid", "" + foodid);
          Log.e("areaid", "" + areaid);
  
          params.put("DeliveryAreaID", areaid);
          params.put("ProvideOffers", "0");
          params.put("NewRestaurant", "0");
          params.put("PaymentMethod", "0");
          params.put("OpenRestaurant", "0");
          params.put("FoodID", foodid);
  
          return params;
      }
  };
  
  RequestQueue restrolistqueuefilter = Volley.newRequestQueue(getContext());
  restrolistrequestfilter.setShouldCache(false);
  restrolistqueuefilter.add(restrolistrequestfilter);
  </code></pre>
  
  <p>}</p>
  
  <p><strong>This is my Adpater Class</strong></p>
  
  <pre><code>public class RestroListBaseAdapter extends BaseAdapter {
  
      private ArrayList&lt;PojoRestaurant&gt; mList;
      private Context mContext;
      private ViewHolder viewHolder;
      private ArrayList&lt;PojoRestaurant&gt; suggestion = new ArrayList&lt;&gt;();
  
      public RestroListBaseAdapter(Context mContext, ArrayList&lt;PojoRestaurant&gt; mList) {
  
          this.mContext = mContext;
          this.mList = mList;  
      }
  
      @Override
      public int getCount() {
          if (mList != null) {
              return mList.size();    
          }
          return 0;
      }
  
      @Override
      public Object getItem(int position) {
          return mList.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          int lastPosition = -1;
          LayoutInflater layoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          if (convertView == null) {
              convertView = layoutInflater.inflate(R.layout.restaurant_item, parent, false);
              viewHolder = new ViewHolder();
              viewHolder.RestroName = (TextView) convertView.findViewById(R.id.tv_restro_name);
              viewHolder.OpenClose = (TextView) convertView.findViewById(R.id.tvOpenClose);
              viewHolder.MinimumOrder = (TextView) convertView.findViewById(R.id.tv_minimun_order);
              viewHolder.DeliveryTime = (TextView) convertView.findViewById(R.id.tv_delivery_time);
              viewHolder.PaymentOption = (TextView) convertView.findViewById(R.id.tv_Payment);
              viewHolder.RestroImage = (ImageView) convertView.findViewById(R.id.img_restro_list);  
          } else {
              viewHolder = (ViewHolder) convertView.getTag();
          }    
  
          Animation animation = AnimationUtils.loadAnimation(mContext, (position &gt; lastPosition) ? R.anim.up_from_bottom : R.anim.down_from_top);
          convertView.startAnimation(animation);
          lastPosition = position;    
  
          convertView.setTag(viewHolder);
  
          PojoRestaurant pojoRestaurant = (PojoRestaurant) getItem(position);
  
          viewHolder.RestroName.setText(pojoRestaurant.getRestroName());
          viewHolder.DeliveryTime.setText(pojoRestaurant.getDeliveryTime());
          viewHolder.MinimumOrder.setText(pojoRestaurant.getMinimumOrder());
          viewHolder.OpenClose.setText(pojoRestaurant.getOpenClose());
          viewHolder.PaymentOption.setText(pojoRestaurant.getPaymentOption());
          Picasso.with(mContext).load(pojoRestaurant.getRestroImage()).into(viewHolder.RestroImage);
  
          return convertView;
      }
  
      private class ViewHolder {
          private TextView RestroName, OpenClose, MinimumOrder, DeliveryTime, PaymentOption;
          private ImageView RestroImage;
  
      }
  }
  </code></pre>