I have a search defined in 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'
When analyzing (analysis → code verification), the lint tool reports the following problem:
SearchView.clearFocus can only be called from one group library (groupId = com.android.support)
I'm not sure what I'm doing wrong, can someone provide me a solution?
source share