use of android.provider.SearchRecentSuggestions in project HoloEverywhere by Prototik.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSearchRecentSuggestions = new SearchRecentSuggestions(this, SuggestionProvider.class.getName(), SearchRecentSuggestionsProvider.DATABASE_MODE_QUERIES);
}
use of android.provider.SearchRecentSuggestions in project weiciyuan by qii.
the class SearchMainActivity method handleIntent.
private void handleIntent(Intent intent) {
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
String query = intent.getStringExtra(SearchManager.QUERY);
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this, SearchSuggestionProvider.AUTHORITY, SearchSuggestionProvider.MODE);
suggestions.saveRecentQuery(query, null);
search(query);
}
}
use of android.provider.SearchRecentSuggestions in project weiciyuan by qii.
the class SearchMainParentFragment method search.
private void search(final String q) {
if (!TextUtils.isEmpty(q)) {
this.q = q;
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(getActivity(), SearchSuggestionProvider.AUTHORITY, SearchSuggestionProvider.MODE);
suggestions.saveRecentQuery(this.q, null);
switch(viewPager.getCurrentItem()) {
case 0:
((SearchStatusFragment) getSearchWeiboFragment()).search();
break;
case 1:
((SearchUserFragment) getSearchUserFragment()).search();
break;
}
}
}
use of android.provider.SearchRecentSuggestions in project Etar-Calendar by Etar-Group.
the class GeneralPreferences method onPreferenceTreeClick.
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
final String key = preference.getKey();
if (KEY_CLEAR_SEARCH_HISTORY.equals(key)) {
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(getActivity(), Utils.getSearchAuthority(getActivity()), CalendarRecentSuggestionsProvider.MODE);
suggestions.clearHistory();
Toast.makeText(getActivity(), R.string.search_history_cleared, Toast.LENGTH_SHORT).show();
return true;
} else {
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
}
use of android.provider.SearchRecentSuggestions in project Etar-Calendar by Etar-Group.
the class SearchActivity method search.
private void search(String searchQuery, Time goToTime) {
// save query in recent queries
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this, Utils.getSearchAuthority(this), CalendarRecentSuggestionsProvider.MODE);
suggestions.saveRecentQuery(searchQuery, null);
EventInfo searchEventInfo = new EventInfo();
searchEventInfo.eventType = EventType.SEARCH;
searchEventInfo.query = searchQuery;
searchEventInfo.viewType = ViewType.AGENDA;
if (goToTime != null) {
searchEventInfo.startTime = goToTime;
}
mController.sendEvent(this, searchEventInfo);
mQuery = searchQuery;
if (mSearchView != null) {
mSearchView.setQuery(mQuery, false);
mSearchView.clearFocus();
}
}
Aggregations