pra*_*ran 1 android google-search
我想在我的 Android 应用程序中显示谷歌搜索结果,当用户在 editText 中输入单词并单击搜索按钮以获取谷歌搜索结果并显示在我的应用程序内部时。我没有执行此操作的经验。请帮助我任何人
private static final String GOOGLE_SERACH_URL = "https://www.google.com/search?q=";
Run Code Online (Sandbox Code Playgroud)
然后只需在 URL 后面附加您想要在 google 上搜索的键,并将查询字符串加载到 WebView 中即可。
webView = (WebView) rootView.findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(GOOGLE_SERACH_URL + searchKey);
Run Code Online (Sandbox Code Playgroud)
工作示例
https://github.com/hiteshsahu/Android-Universal-Web-Content-Loader
| 归档时间: |
|
| 查看次数: |
7115 次 |
| 最近记录: |