Simlified invalidation of options menu. #595

This commit is contained in:
Tom Hennen 2015-01-11 18:53:11 -05:00
parent 77840bea99
commit 86e5e9ea13
1 changed files with 3 additions and 11 deletions

View File

@ -294,17 +294,9 @@ public class QueueFragment extends Fragment {
} }
listAdapter.notifyDataSetChanged(); listAdapter.notifyDataSetChanged();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// we need to refresh the options menu because it sometimes // we need to refresh the options menu because it sometimes
// needs data that may have just been loaded. // needs data that may have just been loaded.
// Things will still work on APIs lower than honeycomb getActivity().supportInvalidateOptionsMenu();
// but they may have to change away from this view
// and then back to get the options menu.
Activity theActivity = activity.get();
if (theActivity != null) {
theActivity.invalidateOptionsMenu();
}
}
} }
private DownloadObserver.Callback downloadObserverCallback = new DownloadObserver.Callback() { private DownloadObserver.Callback downloadObserverCallback = new DownloadObserver.Callback() {