I assume that the problem you're experiencing is that, when you call
startSearch(), 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 call startSearch() 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
-~----------~----~----~----~------~----~------~--~---