Advertisement
Guest User

Collapsable search view

a guest
Mar 28th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1.  if (utility.hasICS()) {
  2.                 // This listener added in ICS
  3.                 searchItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() {
  4.                     @Override
  5.                     public boolean onMenuItemActionExpand(MenuItem menuItem) {
  6.                         // Nothing to do when the action item is expanded
  7.                         return true;
  8.                     }
  9.  
  10.                     @Override
  11.                     public boolean onMenuItemActionCollapse(MenuItem menuItem) {
  12.                         // When the user collapses the SearchView the current search string is
  13.                         // cleared and the loader restarted.
  14.                         if (!TextUtils.isEmpty(mSearchTerm)) {
  15.                           //  onSelectionCleared();
  16.                         }
  17.                         mSearchTerm = null;
  18.                         getSupportLoaderManager().restartLoader(QUERY_ID, null, LocationActivity.this);
  19.                         return true;
  20.                     }
  21.                 });
  22.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement