I am developing an android application for the first time.
I am able to do a http://www.google.com search with this code:
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) {
}
}
But is it also possible to do a search like that on images.google.com (with a word that was filled in the editText-widget)?
Thanks in advance.
I don’t find an elegant way. But you can use this 🙂
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"));whereq='Your_search_text'