0

I found out that there is a way to support devices with older OS (GingerBread and Older) even if you are using SearchView function that is designed for HoneyComb and Later OS. I tried putting this method as it was show in the docs:

public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.search:
            onSearchRequested();
            return true;
        default:
            return false;
    }
}

Now, when I first click the Search button at the action bar

  • the actionbar turns white
  • I press the back arrow beside the icon, actionbar turns black, but search box is still not closed.
  • I type something, press Enter then Search Activity is shown.
  • I click the search button again, the Action bar background turns to black again.

Can you explain why is this happening? I am running the app on Galaxy S4. Thanks for those who will respond.

Jeongbebs
  • 4,100
  • 7
  • 34
  • 60

0 Answers0