Search in sources :

Example 11 with SearchRecentSuggestions

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);
}
Also used : SearchRecentSuggestions(android.provider.SearchRecentSuggestions)

Example 12 with SearchRecentSuggestions

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);
    }
}
Also used : SearchRecentSuggestions(android.provider.SearchRecentSuggestions)

Example 13 with SearchRecentSuggestions

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;
        }
    }
}
Also used : SearchRecentSuggestions(android.provider.SearchRecentSuggestions)

Example 14 with SearchRecentSuggestions

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);
    }
}
Also used : SearchRecentSuggestions(android.provider.SearchRecentSuggestions)

Example 15 with SearchRecentSuggestions

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();
    }
}
Also used : EventInfo(com.android.calendar.CalendarController.EventInfo) SearchRecentSuggestions(android.provider.SearchRecentSuggestions)

Aggregations

SearchRecentSuggestions (android.provider.SearchRecentSuggestions)15 TwitterException (twitter4j.TwitterException)2 AlertDialog (android.app.AlertDialog)1 SearchManager (android.app.SearchManager)1 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 SharedPreferences (android.content.SharedPreferences)1 Uri (android.net.Uri)1 SearchView (android.support.v7.widget.SearchView)1 MenuInflater (android.view.MenuInflater)1 MenuItem (android.view.MenuItem)1 EventInfo (com.android.calendar.CalendarController.EventInfo)1 MainActivity (com.klinker.android.twitter.activities.MainActivity)1 LoginActivity (com.klinker.android.twitter.activities.setup.LoginActivity)1 HashtagDataSource (com.klinker.android.twitter.data.sq_lite.HashtagDataSource)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 Twitter (twitter4j.Twitter)1