コード例 #1
0
 @Override
 public void onResume() {
   super.onResume();
   getPreferences();
   updateUnwatchedCounts();
   onLoadRemainingCounter();
   EventBus.getDefault().register(this);
 }
コード例 #2
0
  private void onSortOrderChanged() {
    getPreferences();

    Utils.trackCustomEvent(getActivity(), TAG, "Sorting", mSorting.name());

    // restart loader and update menu description
    getLoaderManager()
        .restartLoader(OverviewActivity.SEASONS_LOADER_ID, null, SeasonsFragment.this);
    getActivity().invalidateOptionsMenu();
  }
コード例 #3
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    getPreferences();

    // populate list
    mAdapter = new SeasonsAdapter(getActivity(), null, 0, this);
    setListAdapter(mAdapter);
    // now let's get a loader or reconnect to existing one
    getLoaderManager().initLoader(OverviewActivity.SEASONS_LOADER_ID, null, this);

    // listen to changes to the sorting preference
    final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
    prefs.registerOnSharedPreferenceChangeListener(mPrefsListener);

    registerForContextMenu(getListView());
    setHasOptionsMenu(true);
  }