I have an activity with EditText and Button. When user is pressing the button i need to launch Google Now Search from my Activity and pass a text from EditText to make Google Now search for this text. How can i do this?
Asked
Active
Viewed 3,260 times
3
-
Use their API and call it in your application, – Uma Kanth Jul 01 '15 at 08:51
1 Answers
6
Try this
String query = editText.getText().toString();
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
intent.setClassName("com.google.android.googlequicksearchbox", "com.google.android.googlequicksearchbox.SearchActivity");
intent.putExtra("query", query);
startActivity(intent);
you can get more info here

Udit Mukherjee
- 687
- 5
- 20