我是第一次开发android应用程序。
我可以使用以下代码进行www.google.com搜索:

    public void onSearchClick(View v) {
    try {
        Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
        String term = editText.getText().toString();
        intent.putExtra(SearchManager.QUERY, term);
        startActivity(intent);
    } catch (Exception ex) {

    }

}


但是,是否也可以在images.google.com上进行类似的搜索(用editText-widget中的单词填充)?
提前致谢。

最佳答案

我找不到优雅的方法。但是您可以使用:) intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://images.google.com/search?num=10&hl=en&site=&tbm=isch&source=hp‌​&biw=1366&bih=667&q=cars&oq=cars&gs_l=img.3..0l10.748.1058.0.1306.4.4.0.0.0.0.165‌​.209.2j1.3.0...0.0...1ac.1.8RNsNEqlcZc"));其中q='Your_search_text'

10-07 19:22
查看更多