title: Android Custom listView Adapter Filter not going back to original list
body: <p>I have edited my Adapter class and extended the filterable class.  My search functionality works but i am unable to go back to the original content if I backspace everything in the search menu.</p>
  
  <p>here is my adapter class:</p>
  
  <pre><code>public class Menu_List_Item_Adapter extends BaseAdapter implements Filterable {
  Context context;
  List&lt;FoodMenuRowItem&gt; rowItems;
  
  public Menu_List_Item_Adapter(Context context, List&lt;FoodMenuRowItem&gt; items) {
      this.context = context;
      this.rowItems = items;
  }   
  private class ViewHolder {
      ImageView imageView;
      TextView txtTitle;
      TextView txtDesc;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder = null;
  
      LayoutInflater mInflater = (LayoutInflater) context
              .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
      if (convertView == null) {
          convertView = mInflater.inflate(R.layout.food_menu_item_list_row,
                  null);
          holder = new ViewHolder();
          holder.txtDesc = (TextView) convertView.findViewById(R.id.price);
          holder.txtTitle = (TextView) convertView
                  .findViewById(R.id.description);
          holder.imageView = (ImageView) convertView.findViewById(R.id.img);
          convertView.setTag(holder);
      } else {
          holder = (ViewHolder) convertView.getTag();
      }
  
      FoodMenuRowItem rowItem = (FoodMenuRowItem) getItem(position);
  
      holder.txtDesc.setText(rowItem.getDesc());
      holder.txtTitle.setText(rowItem.getTitle());
      holder.imageView.setImageResource(rowItem.getImageId());
  
      return convertView;
  }
  
  @Override
  public int getCount() {
      return rowItems.size();
  }
  
  @Override
  public Object getItem(int position) {
      return rowItems.get(position);
  }
  
  @Override
  public long getItemId(int position) {
      return rowItems.indexOf(getItem(position));
  }
  
  @Override
  public Filter getFilter() {
      return new Filter() {
          @SuppressWarnings("unchecked")
          @Override
          protected void publishResults(CharSequence constraint,
                  FilterResults results) {
  
              if (results.count == 0)
                  notifyDataSetInvalidated();
              else {
                  rowItems = (List&lt;FoodMenuRowItem&gt;) results.values;
                  Menu_List_Item_Adapter.this.notifyDataSetChanged();
              }
  
          }
  
          @Override
          protected FilterResults performFiltering(CharSequence constraint) {
  
              FilterResults results = new FilterResults();
  
              if (constraint == null || constraint.length() == 0) {
                  // No filter implemented we return all the list
                  results.values = rowItems;
                  results.count = rowItems.size();
  
              } else { // We perform filtering operation
                  List&lt;FoodMenuRowItem&gt; filteredRowItems = new ArrayList&lt;FoodMenuRowItem&gt;();
  
                  for (FoodMenuRowItem p : rowItems) {
                      if (p.getName()
                              .toUpperCase()
                              .startsWith(constraint.toString().toUpperCase())) {
                          filteredRowItems.add(p);
                      }
                  }
                  results.values = filteredRowItems;
                  results.count = filteredRowItems.size();
              }
              return results;
          }
      };
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I do check if the results are zero or null and if so to return the original list?
  What am I missing?</p>