private void clearSuggestions() { if (mUpdateSuggestionsTask != null) { mUpdateSuggestionsTask.cancel(false); mUpdateSuggestionsTask = null; } setSuggestionsCursor(null); }
private void updateSuggestions() { clearAllTasks(); if (mQuery == null) { setSuggestionsCursor(null); } else { mUpdateSuggestionsTask = new UpdateSuggestionsTask(); mUpdateSuggestionsTask.execute(mQuery); } }
private void clearAllTasks() { if (mUpdateSearchResultsTask != null) { mUpdateSearchResultsTask.cancel(false); mUpdateSearchResultsTask = null; } if (mUpdateSuggestionsTask != null) { mUpdateSuggestionsTask.cancel(false); mUpdateSuggestionsTask = null; } }