I am trying to implement a search dialog in a Mono Android application for documentation here: http://developer.android.com/guide/topics/search/search-dialog.html
I have an activity that the user should be able to search at:
[Activity (Label = "MyActivity", MainLauncher = true, Icon = "@drawable/icon", Theme = "@style/MyStyle")] [MetaData ("android.app.default_searchable", Value = ".SearchActivity")] public class MainActivity : BaseActivity {...
I have a search operation (where there will be a heavy climb):
[Activity(Theme = "@style/MyStyle", Label = "Searchable", LaunchMode = Android.Content.PM.LaunchMode.SingleTop)] [IntentFilter(new[] { Intent.ActionMain }, Categories = new[] { Intent.CategoryLauncher, Intent.ActionSearch })] [MetaData("searchable", Resource = "@xml/searchable")] public class SearchActivity : BaseActivity { ...
And I have my searchable.xml:
<?xml version="1.0" encoding="utf-8"?> <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:label="MyLabel" android:hint="Search Products"> </searchable>
When I press the search key on the phone in MainActivity, nothing happens - there is no dialogue. I think my problem is how attributes translate to AndroidManifest.xml at runtime, but I'm not sure.
UPDATE 1/3/2012: I published a project deferred to the most basic elements. Press the search button on your Android and you will see SearchDialog, but it will not appear: Demo project here
dubj
source share