谷歌搜索没有谷歌搜索栏

时间:2014-05-20 15:13:21

标签: java android

我正在关闭应用程序的结束阶段并遇到一个不熟悉的问题。我能够在我的应用程序中实现谷歌搜索栏,但不需要搜索栏本身。当用户从列出的预选项目中进行选择时,我需要将其发送到谷歌搜索引擎而不在应用程序上实际拥有搜索栏。谁能指点我这个问题的方向?谢谢你的帮助

4 个答案:

答案 0 :(得分:1)

使用可以像这样定义网址,其中X是搜索。

https://www.google.se/search?q=X

答案 1 :(得分:0)

只需添加您希望用户获取搜索结果的任何内容到https://www.google.com/#q=

的末尾

因此,如果您希望他们搜索" butts",那就是https://www.google.com/#q=butts

答案 2 :(得分:0)

您可以直接通过Google REST API进行搜索。

使用类似的东西:

GET https://www.googleapis.com/customsearch/v1?key=INSERT_YOUR_API_KEY&cx=017576662512468239146:omuauf_lfve&q=lectures

以下更多信息: https://developers.google.com/custom-search/json-api/v1/using_rest

答案 3 :(得分:0)

是的!您可以在活动中使用EditText,然后可以实现为google search条,通过使用Implicit Intent

在MainActivity中:

Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);String urlString= editTextID.getText().toString();
intent.putExtra(SearchManager.QUERY, urkString);
startActivity(intent);

我希望它对大家有帮助!!!!