コード例 #1
0
  @Override
  public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    mNavigationAdapter.swapCursor(data);
    mPagerAdapter.swapCursor(data);

    selectTraining(mPosition);
  }
コード例 #2
0
  /**
   * Show selected training and set its behavior
   *
   * @param position Position of the training
   */
  private void selectTraining(int position) {
    mPosition = position;

    if (mNavigationSpinner.getSelectedItemPosition() != position)
      mNavigationSpinner.setSelection(position);

    if (mViewPager.getCurrentItem() != position) mViewPager.setCurrentItem(position);

    TrainingSetsFragment fragment = (TrainingSetsFragment) mPagerAdapter.getItem(position);
    mBottomMenu.setOnMenuItemClickListener(fragment);
  }
コード例 #3
0
 @Override
 public void onLoaderReset(Loader<Cursor> loader) {
   mNavigationAdapter.swapCursor(null);
   mPagerAdapter.swapCursor(null);
 }