It took me a lot time to figure out the problem.

 <searchable xmlns:android="http://schemas.android.com/apk/res/
android"
     android:label="@string/search_label"
     android:hint="@string/search_hint" >
 </searchable>

Note that all user-visible strings must be provided in the form of
"@string" references. Hard-coded strings, which cannot be localized,
will not work properly in search metadata.

The following lines are copied from
http://code.google.com/android/reference/android/app/SearchManager.html#FilterSearchApplications


On Oct 27, 11:47 pm, "Andrew Stadler" <[email protected]> wrote:
> I assume that the problem you're experiencing is that, when you 
> callstartSearch(), nothing happens?  If this is the case, read on.  If
> this is not the case, please write back with additional information
> about what you expected and what actually happened.
>
> From looking at your implementation of onSearchRequested(), it looks
> like you're trying to implement some additional or non-standard
> functionality.  It would be helpful if you could describe what exactly
> you're trying to accomplish here, from a UI perspective.
>
> However, just looking at the code, I see a couple of things that look odd:
> (1)  What exactly are you trying to store in the bundle, and why?
> These are typically used only for special cases where you need access
> to that same data in the search intent receiver.
> (2)  It doesn't make sense to call this:
>     webView.requestFocus();
> After you try and launch the search UI.  The search UI will want
> focus, and you're just creating a race condition.
>
> For now, I would recommend simply removing onSearchRequested() and let
> the base method in Activity take care of things.  After the basic
> search invocation is debugged and working, you can start to build it
> back in and add the special functionality you want.
>
> If you callstartSearch() and "nothing happens", it may mean that your
> search metadata is either incorrect or insufficient.  One thing you
> can do is examine the output of "adb logcat" and see if the search
> manager is writing any diagnostic information to the logs.
>
> You can also post snippets of your manifest, and your searchable.xml
> file, here if you'd like anyone here to take a closer look at it.
>
> No permissions are required to invoke the search UI.  Specific apps
> may depend on the INTERNET permission, but only if their searchable
> activity (or suggestions provider) use the network to gather data.
>
> Hope this helps.
>
> On Thu, Oct 23, 2008 at 1:47 AM, anirudh Bhatnagar <[email protected]> 
> wrote:
> > I am trying to implement the search functionality in my app,But I am not
> > able to get the page,Following is the code :
>
> > public void onCreate(Bundle savedInstanceState) {
>
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.web_view);
>
> >         onSearchRequested();
> >     }
>
> > public boolean onSearchRequested() {
>
> > EditText searchString = (EditText) findViewById(R.id.searchText);
> > webView = (WebView) findViewById(R.id.browser);
>
> > Bundle dataBundle = new Bundle();
>
> > dataBundle.putString("null", searchString );
>
> >  startSearch(queryPrefill, false, appDataBundle, false);
> > webView.requestFocus();
>
> >   return true;
> > }
>
> > I have even set the User permission in AndroiManifest.xml for INTERNET.
>
> > Thanks,
> > Anirudh
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to