title: android listview searching getting null pointer error
body: <p>Hello all i want to add search funcationality to listview for that i have doen following </p>
  
  <pre><code>    @Override
      public Filter getFilter() {
          if (valueFilter == null) {
              valueFilter = new ValueFilter();
          }
          return valueFilter;
      }
  
      private class ValueFilter extends Filter {
  
          @Override
          protected FilterResults performFiltering(CharSequence constraint) {
              FilterResults results = new FilterResults();
  
              if (constraint != null &amp;&amp; constraint.length() &gt; 0) {
  
                  for (int i = 0; i &lt; mStringFilterList.size()-1; i++) {
                      if ((mStringFilterList.get(i).getServiceName().toString())
                              .contains(constraint.toString())) {
                          // Contacts contacts = new Contacts();
  
  
                          contacts.setServiceName(mStringFilterList.get(i)
                                  .getServiceName());
                          contacts.setAmount(mStringFilterList.get(i).getAmount()
                                  + "");
                          System.out
                                  .println("mStringFilterList.get(i).getAmount()"
                                          + mStringFilterList.get(i).getAmount());
                          contacts.setTrnDate(mStringFilterList.get(i)
                                  .getTrnDate());
                          System.out
                                  .println("mStringFilterList.get(i).getTrnDate()"
                                          + mStringFilterList.get(i).getTrnDate());
                          filterList.add(contacts);
                      }
                  }
                  results.count = filterList.size();
                  results.values = filterList;
              } else {
                  results.count = mStringFilterList.size();
                  results.values = mStringFilterList;
              }
              return results;
          }
  
          @Override
          protected void publishResults(CharSequence constraint,
                  FilterResults results) {
               list=(ArrayList&lt;Contacts&gt;) results.values;
  
              notifyDataSetChanged();
          }
  
      }
  
  }
  </code></pre>
  
  <p>But getting error on <code>mStringFilterList.get(i).getServiceName().toString())</code></p>