@Override public void onPause() { super.onPause(); if (searchItem != null && MenuItemCompat.isActionViewExpanded(searchItem)) { MenuItemCompat.collapseActionView(searchItem); } }
@Override protected void onStop() { if ((searchMenuItem != null) && (MenuItemCompat.isActionViewExpanded(searchMenuItem))) { MenuItemCompat.collapseActionView(searchMenuItem); } LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this); lbm.unregisterReceiver(scheduleDownloadProgressReceiver); lbm.unregisterReceiver(scheduleDownloadResultReceiver); super.onStop(); }