Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Search field in actionBar doesn't open

$
0
0

I'm loading data from a remote server and add it to a listview. To search the listview I want to add a search field to the actionBar (Android). When I tap the search icon in the actionBar the search field doesn't open. I'm able to add the search field to the listview, but not the actionBar. (with SDK 3.3.0)

I was previously using a tableview (with SDK 3.2) and the search bar would appear in the actionBar. The code for search is nearly identical.

Here's what I have with the listview.

search = Ti.UI.Android.createSearchView({
        hintText : "Search Memberships"
    });
self.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 ? Ti.Android.R.drawable.ic_menu_search : "images/about.png"),
            showAsAction : Ti.Android.SHOW_AS_ACTION_IF_ROOM | Ti.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW
        });
    };
listView = Ti.UI.createListView({
        templates : {
            'template' : myTemplate
        },
        defaultItemTemplate : 'template',
        backgroundColor : '#fff',
        searchView : search,
        caseInsensitiveSearch : true,
        top : bgView.height
    });
    self.add(listView);
Any ideas what's going on?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>