protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ExerciseHistory); ResetPromptData(); if (savedInstanceState != null) { _checkForIntentData = savedInstanceState.GetBoolean(Constants.CheckForIntentData, true); } else { _checkForIntentData = true; } if (_checkForIntentData) { _showMarkExercisePrompt = Intent.GetBooleanExtra(Constants.ShowMarkedExercisePrompt, false); _notifiedExerciseId = Intent.GetIntExtra(Constants.ExerciseId, -1); } var adapter = new ExerciseHistoryFragmentAdapter(SupportFragmentManager); _pager = FindViewById <ViewPager>(Resource.Id.historyPager); _pager.Adapter = adapter; _pager.SetCurrentItem(adapter.Count, false); }
private void UpdateData() { var currentPosition = _pager.CurrentItem; var adapter = new ExerciseHistoryFragmentAdapter(SupportFragmentManager); _pager.Adapter = adapter; _pager.SetCurrentItem(currentPosition, false); }