如何调用指定的浏览器访问百度搜索引擎

来源:互联网 发布:在线子域名查询 编辑:程序博客网 时间:2024/05/01 23:14

百度搜索引擎地址:http://m.baidu.com?from=1093f&word=URLEncoder.encode(query, "UTF-8");

其中query:搜索的内容(ex:应用宝)

String searchUri = mSearchDomainHelper.getBaiduUrl()

                    + "from=1093f&word=" + URLEncoder.encode(query, "UTF-8");
Intent launchUriIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(searchUri));
launchUriIntent.setClassName("com.android.browser","com.android.browser.BrowserActivity");//指定系统内置浏览器
launchUriIntent.putExtra(Browser.EXTRA_APPLICATION_ID, applicationId);
launchUriIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(launchUriIntent);
0 0