Code example for SearchableInfo

Methods: getSearchActivity

0
 
    private final CharSequence mLabel;
     
    private MyDefaultSearchEngine(Context context, SearchableInfo searchable) {
        mSearchable = searchable;
        mLabel = loadLabel(context, mSearchable.getSearchActivity());
    } 
     
    public static MyDefaultSearchEngine getInstance(Context context) {
        SearchManager searchManager =
                (SearchManager) context.getSystemService(Context.SEARCH_SERVICE);
//        ComponentName name = searchManager.getWebSearchActivity(); 
        ComponentName name = (ComponentName) MyInvokeSearchManagerMethod.getWebSearchActivity(searchManager);
 
        if (name == null) return null;
        SearchableInfo searchable = searchManager.getSearchableInfo(name);
        if (searchable == null) return null;
        return new MyDefaultSearchEngine(context, searchable);
    } 
     
    private CharSequence loadLabel(Context context, ComponentName activityName) {