title: Removing Duplicates From ListView android
body: <p>I am posting my code, I am unable to remove the duplicate values from the listview?
  Can someone please help me? Thanks in advance!
  I am pasting my code here and I have used <code>BaseAdapter</code>.</p>
  
  <hr>
  
  <pre><code>@Override
              public void onCompleted(final List&lt;Recommendable&gt; result) {
                  android.util.Log.w("suggestionview&gt;&gt;&gt;&gt;&gt;", "suggestion"+ result.size());
                  ((Activity) mContext).runOnUiThread(new Runnable() {
                      public void run() {
                          Iterator&lt;Recommendable&gt; itr = result.iterator();
                          while (itr.hasNext()) {
                              Recommendable element = itr.next();
                              suggestions.add(element);
                              android.util.Log.w("suggestionview", "Adding elements::&gt;"+suggestions.add(element));
                          }
                          suggestionListView.setAdapter(new Suggestiondapter(mContext));
                          android.util.Log.w("suggestionview","suggestion adapter Values::&gt;"+suggestionListView);
                      }
                  });
  </code></pre>
  
  <h2>And the second of the code</h2>
  
  <pre><code>public class Suggestiondapter extends BaseAdapter {
  
  
      // private LayoutInflater mInflater = null;
      private Context mContext;
  
      public Suggestiondapter(Context mContext) {
          this.mContext=mContext;
          android.util.Log.w("Suggestion Adapter","vlues are comming.....");
      }
  
      @Override
      public int getCount() {
          android.util.Log.w("suugestion adapter","suggstion size::&gt;"+suggestions.size());
          return suggestions.size();
      }
  
      @Override
      public Object getItem(int position) {
          return position;
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          Recommendable recommendable = suggestions.get(position);
          if(convertView==null){
              android.util.Log.w("convertView", "adaptervalues........::&gt;"+ recommendable.Program);
              android.util.Log.w("series conveter", "program series values::&gt;"+recommendable.Series);
              convertView = new HeaderView(mContext, recommendable.Program,recommendable.Series, SuggestionView.class);
          }else{
              Toast.makeText(mContext, "HelloView", Toast.LENGTH_SHORT);
          }
          return convertView;
      }
  };
  </code></pre>