本文整理汇总了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) {
}
};
}
示例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);
}
示例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);
}
示例4: webSearch
final void webSearch(String query) {
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
intent.putExtra("query", query);
launchIntent(intent);
}
示例5: processWebSearchIntent
@Override
public void processWebSearchIntent(String query) {
Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);
searchIntent.putExtra(SearchManager.QUERY, query);
startActivity(searchIntent);
}
示例6: webSearch
final void webSearch(String query) {
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
intent.putExtra("query", query);
launchIntent(intent);
}
示例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);
}