當前位置: 首頁>>代碼示例>>Java>>正文


Java Intent.ACTION_WEB_SEARCH屬性代碼示例

本文整理匯總了Java中android.content.Intent.ACTION_WEB_SEARCH屬性的典型用法代碼示例。如果您正苦於以下問題:Java Intent.ACTION_WEB_SEARCH屬性的具體用法?Java Intent.ACTION_WEB_SEARCH怎麽用?Java Intent.ACTION_WEB_SEARCH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.content.Intent的用法示例。


在下文中一共展示了Intent.ACTION_WEB_SEARCH屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createIntentHandlerDelegate

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) {
        }
    };
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:16,代碼來源:ChromeActivity.java

示例2: searchWebFor

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);
}
 
開發者ID:aliumujib,項目名稱:Orin,代碼行數:12,代碼來源:AbsTagEditorActivity.java

示例3: setUpRecyclerView

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);
    }
 
開發者ID:fantasy1022,項目名稱:FancyTrendView,代碼行數:31,代碼來源:FancyTrendActivity.java

示例4: webSearch

final void webSearch(String query) {
  Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
  intent.putExtra("query", query);
  launchIntent(intent);
}
 
開發者ID:PhilippC,項目名稱:keepass2android,代碼行數:5,代碼來源:ResultHandler.java

示例5: processWebSearchIntent

@Override
public void processWebSearchIntent(String query) {
    Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);
    searchIntent.putExtra(SearchManager.QUERY, query);
    startActivity(searchIntent);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:6,代碼來源:ChromeLauncherActivity.java

示例6: webSearch

final void webSearch(String query) {
    Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
    intent.putExtra("query", query);
    launchIntent(intent);
}
 
開發者ID:xiong-it,項目名稱:ZXingAndroidExt,代碼行數:5,代碼來源:ResultHandler.java

示例7: webSearch

public static void webSearch(Context c, String text) {
    Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
    intent.setData(Uri.parse(text));
    c.startActivity(intent);
}
 
開發者ID:victordiaz,項目名稱:phonk,代碼行數:5,代碼來源:Intents.java


注:本文中的android.content.Intent.ACTION_WEB_SEARCH屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。