I'm attempting to utilize a SearchView inside the action bar with Android, and having some trouble with getting things working. I've copied the code samples directly from the docs and still no dice.
Here's what's going on:
index.xml
<Alloy> <Window id="index" class="container"> <Label id="label">Search Bar Test</Label> </Window> </Alloy>
index.js
var win = $.index; var search; var searchAsChild = false; if (Ti.Platform.name == 'android' && Ti.Platform.Android.API_LEVEL >= 11) { // Use action bar search view search = Ti.UI.Android.createSearchView({ hintText : "Table Search" }); win.activity.onCreateOptionsMenu = function(e) { var menu = e.menu; var menuItem = menu.add({ title : 'Table Search', actionView : search, icon : Ti.Android.R.drawable.ic_menu_search, showAsAction : Ti.Android.SHOW_AS_ACTION_IF_ROOM | Ti.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW }); }; } $.index.open();This successfully displays the search icon, but pressing the icon doesn't invoke the SearchView in the ActionBar. Does anything here look incorrect?
Just FYI - I'm targeting SDK version 17, so I'm well in the clear on that requirement.
Thanks so much,
Justin Davis