Hi,
I am new for android Development. I am looking to develop a search
application, which will search on google search engine.
I am referring Api Demo searchInvoke example from android samples. I
modified onSearchRequested() as below...
public boolean onSearchRequested() {
// If your application absolutely must disable search, do it
here.
if (mMenuMode.getSelectedItemPosition() == MENUMODE_DISABLED)
{
return false;
}
// It's possible to prefill the query string before launching
the search
// UI. For this demo, we simply copy it from the user input
field.
// For most applications, you can simply pass null to
startSearch() to
// open the UI with an empty query string.
final String queryPrefill = mQueryPrefill.getText().toString
();
// Next, set up a bundle to send context-specific search data
(if any)
// The bundle can contain any number of elements, using any
number of keys;
// For this Api Demo we copy a string from the user input
field, and store
// it in the bundle as a string with the key "demo_key".
// For most applications, you can simply pass null to
startSearch().
Bundle appDataBundle = null;
final String queryAppDataString = mQueryAppData.getText
().toString();
if (queryAppDataString != null) {
appDataBundle = new Bundle();
appDataBundle.putString("demo_key", queryAppDataString);
}
// Now call the Activity member function that invokes the
Search Manager UI.
startSearch(queryPrefill, true, appDataBundle, true);
// Returning true indicates that we did launch the search,
instead of blocking it.
return true;
}
When i executes this program, goggle search bar came with my entered
data and search button. After pressing search button it is opening
default goggle search home page.
I want that if i press at search at goggle bar, it should show search
result page directly. Please help me out.
Thanks in advance.
Amit
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---