title: Google Places Autocomplete API implementation error in Android
body: <p>I am following <a href="http://examples.javacodegeeks.com/android/android-google-places-autocomplete-api-example/" rel="nofollow">this</a> tutorial to implement the auto-complete API from Google Places set of APIs. When extending the class from <code>ArrayAdapter</code> and implementing the <code>Filterable</code> interface, the Android SDK is not able to resolve the methods shown in the tutorial but rather shows only this method:</p>
  
  <pre><code>@Override
  public boolean isLoggable(LogRecord record) {
         return false;
  }
  </code></pre>
  
  <p>The adapter class implementation is shown below:</p>
  
  <pre><code> class GooglePlacesAutocompleteAdapter extends ArrayAdapter implements Filterable
      {
          private ArrayList resultList;
  
          public GooglePlacesAutocompleteAdapter(Context context, int textViewResourceId) {
              super(context, textViewResourceId);
          }
  
          @Override
          public int getCount()
          {
              return resultList.size();
          }
  
          @Override
          public String getItem(int index)
          {
              return resultList.get(index).toString();
          }
  
          @Override
          public Filter getFilter()
          {
              Filter filter = new Filter() {
                  @Override
                  public boolean isLoggable(LogRecord record) {
                      return false;
                  }
  
                  @Override
                  public android.widget.Filter.FilterResults performFiltering(CharSequence constraint)
                  {
                      android.widget.Filter.FilterResults filterResuts = new android.widget.Filter.FilterResults();
                      if(constraint != null)
                      {
                          resultList = autocomplete(constraint.toString());
                          filterResuts.values = resultList;
                          filterResuts.count = resultList.size();
                      }
                      return filterResuts;
                  }
  
                  @Override
                  protected void publishResults(CharSequence constraint, android.widget.Filter.FilterResults results)
                  {
                      if (results != null &amp;&amp; results.count &gt; 0) {
                          notifyDataSetChanged();
                      }
                      else {
                          notifyDataSetInvalidated();
                     }
                  }
              };
              return filter;
          }
      }
  </code></pre>
  
  <p>Here, I get the following errors:</p>
  
  <ol>
  <li>The class FilterResults has protected access in class Filter</li>
  <li>Cannot access values in FilterResults</li>
  <li>Cannot access count in FilterResults</li>
  </ol>
  
  <p>As well, it doesn't recognize the other methods (<code>protected FilterResults performFiltering(CharSequence constraint)</code> and <code>protected void publishResults(CharSequence constraint, FilterResults results)</code>). I am using KitKat for developing the application. </p>