uisearchbar - Showing a search bar in Android -
i'm having trouble when trying show search bar @ top of app. want bar visible hole application (in activities) when app starts, no need user press button, i'm trying use android's searchable function. here's i've got far:
manifest.xml
<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> </activity> <activity android:name=".bigimageview"> <intent-filter> <action android:name="android.intent.action.search" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable"/> </activity> <!-- declare default searchable activity whole app --> <meta-data android:name="android.app.default_searchable" android:value=".bigimageview" /> </application>
res/xml/searchable.xml
<searchable xmlns:android="http://schemas.android.com/apk/res/android" android:label="@string/app_name" android:hint="@string/search_hint" >
can accomplish or user need press buttons invoke search bar?
you put
onsearchrequested();
in onresume()
- search bar hide if component focus.
if that's not want, should implement own search bar (i.e. autocompletetextview).
Comments
Post a Comment