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();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// we need to refresh the options menu because it sometimes
// needs data that may have just been loaded.
// Things will still work on APIs lower than honeycomb
// 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();
}
}
// we need to refresh the options menu because it sometimes
// needs data that may have just been loaded.
getActivity().supportInvalidateOptionsMenu();
}
private DownloadObserver.Callback downloadObserverCallback = new DownloadObserver.Callback() {