Before updating to 2.2 on a Nexus the following code was doing what I
expected - giving the user a choice of activities to search in for the
query term. Since updating from 2.1 to 2.2  the same code on the Nexus
launches and starts a search on Android Market directly.

Weirdly, on the emulator running 2.2. this same code performs as
expected and launches a chooser for the user to pick which activity to
search in.

Something wrong with my code, a bug in the update, or something else?

Can anyone suggest a work around - I want the user to be able to chose
which activity/application to run the search in (e.g. gmail, you tube,
sms clients, etc).

Intent searchIntent = new Intent();
searchIntent.setAction(Intent.ACTION_SEARCH);
searchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
searchIntent.putExtra(SearchManager.QUERY,
mItemName.getText().toString());
Toast.makeText(this, "Finding searchable applications",
Toast.LENGTH_SHORT).show();
startActivity(Intent.createChooser(searchIntent, "Search in:"));

Thanks

-- 
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