Friday, March 23, 2012

Start the browser with a search query in android.


Start the browser with a search query in android.


In android we can simply start a browser or start the browser with a supplied search query.
Remember that we start the browser using an intent and we can put extra parameters in an intent.
Here in the browser intent we can supply the search query as a “SearchManager.QUERY” and giving the value.
?
Drag and copy the code
1
2
3
Intent search = new Intent(Intent.ACTION_WEB_SEARCH);
search.putExtra(SearchManager.QUERY, "ANDROID");
startActivity(search);

No comments: