Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to start a browser with a Google image search query in android

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.

like image 805
Sama Avatar asked Jan 15 '23 10:01

Sama


1 Answers

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

like image 79
Dheeraj Bhaskar Avatar answered Jan 16 '23 22:01

Dheeraj Bhaskar