Вопрос

I was wondering how to start a Browser with a Google image search query "search images by text". For example user can select a certain word or phrase and click a button and the activity will start the browser with the Google image search query.

Thanks in advance.

Это было полезно?

Решение

Create URL like so:

String URLString = "https://www.google.com/search?hl=en&site=imghp&tbm=isch&source=hp&q="+TestString;

Launch it like so:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(URLString));
startActivity(i);

Make sure your TestString is URL Safe

Другие советы

Just need to add tbm=isch

Example:

url: https://www.google.com/search?tbm=isch&q=findSomeImage

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top