SearchView.clearFocus can only be called from within the same library group (groupId=com.android.support)

3.6k views Asked by At

I have a searchview defined in an activity as follows:

import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;

public class SearchActivity extends AppCompatActivity {
  @BindView(R.id.search_view) SearchView searchView;

  private void setupSearchView() {
      SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
      searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
      searchView.setIconified(false);          
      searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override public boolean onQueryTextSubmit(String s) {
          searchView.clearFocus();
          return true;
        }

        @Override public boolean onQueryTextChange(String s) {
          searchFor(s);
          return true;
        }
      });
    }
}

build.gradle

androidBuildToolsVersion = "25.0.2"
androidMinSdkVersion = 16
androidTargetSdkVersion = 25
androidCompileSdkVersion = 25
supportVersion = '25.1.0'

Upon analysing(Analyze -> Inspect code) lint tool reports the following issue:

SearchView.clearFocus can only be called from within the same library group (groupId=com.android.support)

I'm not sure what I'm doing wrong, could anyone provide me a solution?

0

There are 0 answers