Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android search dialog doesn't appear

Hello i am frustrated with the search dialog like presented on http://developer.android.com/guide/topics/search/search-dialog.html

No search dialog is shown to me when i press the search button on my device. here is my simple manifest file:

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".Main"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <meta-data android:name="android.app.default_searchable"
            android:value=".Other" />
    </activity>
    <activity android:name=".Other">
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
            android:resource="@xml/searchable"/>
    </activity>
</application>

My res/xml/searchable.xml looks like this:

<searchable xmlns:android="http://schemas.android.com/apk/res/android"
   android:label="lol"
   android:hint="search" >
</searchable>

in Main.java onSearchRequested() is triggered but no search dialog appears.

am i missing something?

like image 213
bline Avatar asked May 08 '11 10:05

bline


1 Answers

To remove the question from not answered, copying the comment with the solution:

oh my god. this is f*ing stupid. i had to use android:label="@string/xyz" instead of android:label="lol" and no single word about this in the documentation. unbelievable

like image 112
Vincent Mimoun-Prat Avatar answered Oct 22 '22 11:10

Vincent Mimoun-Prat