Bear
Bear

Reputation: 5152

Search Widget fire ACTION_SEARCH intent twice when user search a word

I follow the android documentation to write an application with search widget.

But I found that two ACTION_SEARCH intents are sent to the SearchActivity. So, I doubt that is that my fault.
And then I try the Google Play app. I enter keyword to search app and I still capture two intents! Here is the logcat. So, how should be handle this? Even I override onNewIntent with singleTop Activity, it need to search twice to handle one search operation!

04-18 22:26:19.007: I/ActivityManager(389): START u0 {act=android.intent.action.SEARCH flg=0x10000000 cmp=com.android.vending/.AssetBrowserActivity (has extras)} from pid 1721 04-18 22:26:19.007: I/ActivityManager(389): START u0 {act=android.intent.action.SEARCH flg=0x10000000 cmp=com.android.vending/.AssetBrowserActivity (has extras)} from pid 1721

Upvotes: 0

Views: 623

Answers (1)

museofwater
museofwater

Reputation: 409

This is a bug in the emulator when using the hardware keyboard.

http://books.google.com/books?id=OFXJXbCXjTgC&pg=PT771&lpg=PT771&dq=android+search+intent+sent+twice+bug&source=bl&ots=Ora1AJjh4A&sig=9yFBjCwJ1ARbXePHzcPYpG_QdFQ&hl=en&sa=X&ei=bbddUpbZCcLi4AOiioCIAw&ved=0CD8Q6AEwAw#v=onepage&q=android%20search%20intent%20sent%20twice%20bug&f=false

You can disable the hardware keyboard in the emulator by going to Settings -> Language & input and selecting Default.

When using the soft keyboard in the emulator I only get one intent.

Upvotes: 6

Related Questions