2

I want a drop down to display under the search view when clicked containing a list of previous searches

@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getSupportMenuInflater().inflate(R.menu.categories, menu);
        // Get the SearchView and set the searchable configuration
        SearchView searchView = (SearchView) menu.findItem(R.id.menu_search)
        .getActionView();
        searchView.setQueryHint("Search All Categories");

        final AppListAdapter adapterAllApps = new AppListAdapter(
                CategoryListActivity.this, R.layout.app_row, catList);
        searchView.setOnQueryTextListener(new OnQueryTextListener() {
            @Override
            public boolean onQueryTextChange(String newText) {
    ....
Gaurav Agarwal
  • 18,754
  • 29
  • 105
  • 166
124697
  • 22,097
  • 68
  • 188
  • 315

1 Answers1

0

You might want to use a

AutoCompleteTextView

to do this and then add a searchable content provider.

have a look at this :

Turn AutoCompleteTextView into a SearchView in ActionBar instead

Community
  • 1
  • 1
lokoko
  • 5,785
  • 5
  • 35
  • 68
  • I already have that. My autocomplete works fine now except for history. I need to know how to get it to show the previously searched terms – 124697 Dec 17 '12 at 22:04
  • Try this : http://stackoverflow.com/questions/8510169/keep-different-search-histories-for-different-activities – lokoko Dec 18 '12 at 18:12