1. Download our Official Android App: Forums for Android!

Apps Search suggestions causing inconsistent behavior in application after triggered from Quick Search

Discussion in 'Android Development' started by billkorbecki, Jun 11, 2010.

  1. billkorbecki

    billkorbecki Lurker
    Thread Starter
    Jun 11, 2010

    Jun 11, 2010
    I'm running into an issue with the Quick Search Bar that I'm hoping someone can help me with.

    My application includes a Searchable activity used to provide search behavior within my application. That search activity is designed to trigger a separate Intent when the search item is clicked on so as to cause a different Activity to handle the viewing. When used within the application, the search behavior works perfectly every time.

    My application also includes a ContentProvider used to provide search suggestions and is also configured to allow use in the Quick Search Bar. When used within the application itself, use of the search suggestions works fine every time it is used. When triggered from the QSB, the initial search suggestion brings up the viewing activity just as it should. After that point, however, any use of the search suggestions from within the application (i.e. bringing up the search and selecting a search suggestion) fails to trigger the viewing application. In fact, I've put debug statements in every single "onXXX()" method within the Searchable activity and I never see any of them get triggered. On the flip side, when I trigger a standard search at that same point (i.e. enter a query string and hit enter, rather than navigating to a search suggestion), the search dialog comes up, as expected, and selecting an item from that list successfully triggers my application.

    I'm currently at a loss trying to determine why this would be occurring. Any ideas

    As as some additional information, my manifest contains the following in regards to the searchable activity (".activity.SearchableActivity"), the suggestions provider (".content.TestSuggestionProvider") and the activity used to display the content (".activity.TestDisplayActivity"):

    Code (Text):
    1. <activity
    2.             android:name=".activity.TestDisplayActivity"
    3.             android:label="@string/app_name"
    4.             android:launchMode="singleTask"
    5.             android:finishOnTaskLaunch="true"
    6.             android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    7.             android:screenOrientation="landscape"
    8.             android:configChanges="orientation|keyboardHidden">
    9.             <intent-filter>
    10.                 <action android:name="android.intent.action.MAIN" />
    11.                 <category android:name="android.intent.category.LAUNCHER" />
    12.             </intent-filter>
    13.             <meta-data android:name="android.app.default_searchable" android:value=".activity.SearchableActivity" />
    14.         </activity>
    16.         <activity
    17.             android:name=".activity.SearchableActivity"
    18.             android:launchMode="singleTop"
    19.             android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    20.             <intent-filter>
    21.                 <action android:name="android.intent.action.SEARCH" />
    22.                 <category android:name="android.intent.category.DEFAULT" />
    23.             </intent-filter>
    24.             <meta-data android:name="android.app.searchable" android:resource="@xml/searchable"/>
    25.         </activity>
    27.         <provider
    28.             android:name=".content.TestSuggestionProvider"
    29.             android:authorities="com.test.provider.suggest"
    30.             android:syncable="false"
    31.             />
    And the following is the XML used to further define the settings of the searchable activity:

    Code (Text):
    1. <searchable xmlns:android="http://schemas.android.com/apk/res/android"
    2.         android:label="@string/search_app_label"
    3.         android:hint="@string/search_app_hint"
    4.         android:searchSettingsDescription="@string/search_app_settings_description"
    5.         android:includeInGlobalSearch="true"
    6.         android:voiceSearchMode="showVoiceSearchButton|launchRecognizer"
    7.         android:searchSuggestAuthority="com.test.provider.suggest"
    8.         android:searchSuggestIntentAction="android.intent.action.VIEW">
    9.     </searchable>
    Any thoughts? At the moment I'm at a complete loss


Share This Page