Java Code Examples for android.content.Intent.ACTION_WEB_SEARCH

The following are Jave code examples for showing how to use ACTION_WEB_SEARCH of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: chromium-for-android-56-debug-video   File: ChromeActivity.java   View Source Code Vote up 7 votes
protected IntentHandlerDelegate createIntentHandlerDelegate() {
    return new IntentHandlerDelegate() {
        @Override
        public void processWebSearchIntent(String query) {
            Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);
            searchIntent.putExtra(SearchManager.QUERY, query);
            startActivity(searchIntent);
        }

        @Override
        public void processUrlViewIntent(String url, String referer, String headers,
                TabOpenType tabOpenType, String externalAppId, int tabIdToBringToFront,
                boolean hasUserGesture, Intent intent) {
        }
    };
}
 
Example 2
Project: Orin   File: AbsTagEditorActivity.java   View Source Code Vote up 6 votes
protected void searchWebFor(String... keys) {
    StringBuilder stringBuilder = new StringBuilder();
    for (String key : keys) {
        stringBuilder.append(key);
        stringBuilder.append(" ");
    }
    Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
    intent.putExtra(SearchManager.QUERY, stringBuilder.toString());
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    startActivity(intent);
}
 
Example 3
Project: FancyTrendView   File: FancyTrendActivity.java   View Source Code Vote up 6 votes
private void setUpRecyclerView() {

        googleTrendAdapter = new FancyTrendAdapter(this, trendItemList, Constant.DEFAULT_ROW_NUMBER, new FancyTrendAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(View v, String trend, int position) {
                if (!mVisible) {
                    FancyTrendActivity.this.toggle();
                    FancyTrendActivity.this.delayedHide(AUTO_HIDE_DELAY_MILLIS);
                } else {
                    if (fancyTrendPresenter.getClickBehavior() == SPUtils.ClickBehaviorItem.googleSearch) {
                        //TODO:Use chrome tab to implement
                        Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
                        intent.putExtra(SearchManager.QUERY, trend);
                        startActivity(intent);
                    } else if (fancyTrendPresenter.getClickBehavior() == SPUtils.ClickBehaviorItem.singlecountry) {
                        new MaterialDialog.Builder(FancyTrendActivity.this)
                                .title(R.string.choose_country)
                                .items(R.array.trend_country_name)
                                .itemsCallback((dialog, view, which, text) -> {
                                    String code = Constant.getCountryCode(String.valueOf(text));
                                    fancyTrendPresenter.retrieveSingleTrend(code, position);
                                })
                                .show();
                    }
                }
            }
        });
        trendRecycleView.setLayoutManager(new CustomGridLayoutManager(this, Constant.DEFAULT_COLUMN_NUMBER));
        trendRecycleView.setAdapter(googleTrendAdapter);
        trendRecycleView.setHasFixedSize(true);
    }
 
Example 4
Project: RetroMusicPlayer   File: AbsTagEditorActivity.java   View Source Code Vote up 6 votes
protected void searchWebFor(String... keys) {
    StringBuilder stringBuilder = new StringBuilder();
    for (String key : keys) {
        stringBuilder.append(key);
        stringBuilder.append(" ");
    }
    Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
    intent.putExtra(SearchManager.QUERY, stringBuilder.toString());
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    startActivity(intent);
}
 
Example 5
Project: keepass2android   File: ResultHandler.java   View Source Code Vote up 5 votes
final void webSearch(String query) {
  Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
  intent.putExtra("query", query);
  launchIntent(intent);
}
 
Example 6
Project: weex-3d-map   File: ResultHandler.java   View Source Code Vote up 5 votes
final void webSearch(String query) {
  Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
  intent.putExtra("query", query);
  launchIntent(intent);
}
 
Example 7
Project: chromium-for-android-56-debug-video   File: ChromeLauncherActivity.java   View Source Code Vote up 5 votes
@Override
public void processWebSearchIntent(String query) {
    Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);
    searchIntent.putExtra(SearchManager.QUERY, query);
    startActivity(searchIntent);
}
 
Example 8
Project: ZXingAndroidExt   File: ResultHandler.java   View Source Code Vote up 5 votes
final void webSearch(String query) {
    Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
    intent.putExtra("query", query);
    launchIntent(intent);
}
 
Example 9
Project: tvConnect_android   File: ResultHandler.java   View Source Code Vote up 5 votes
final void webSearch(String query) {
  Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
  intent.putExtra("query", query);
  launchIntent(intent);
}
 
Example 10
Project: tvConnect_android   File: ResultHandler.java   View Source Code Vote up 5 votes
final void webSearch(String query) {
  Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
  intent.putExtra("query", query);
  launchIntent(intent);
}
 
Example 11
Project: phonk   File: Intents.java   View Source Code Vote up 5 votes
public static void webSearch(Context c, String text) {
    Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
    intent.setData(Uri.parse(text));
    c.startActivity(intent);
}
 
Example 12
Project: appinventor-extensions   File: ResultHandler.java   View Source Code Vote up 5 votes
final void webSearch(String query) {
  Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
  intent.putExtra("query", query);
  launchIntent(intent);
}