Skip to content

Commit

Permalink
Fix oppia#1587 : Resolve test cases error. Made intent keys consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Pascal committed Aug 27, 2020
1 parent ad6738d commit e488310
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import org.oppia.app.settings.profile.ProfileListActivity
import javax.inject.Inject

const val SELECTED_CONTROLS_TITLE_KEY = "SELECTED_CONTROLS_TITLE_KEY"
const val LAST_LOADED_FRAGMENT_KEY = "LAST_LOADED_FRAGMENT_KEY"
const val LAST_LOADED_FRAGMENT_SAVED_KEY =
"AdministratorControlsActivity.last_loaded_fragment"
const val PROFILE_LIST_FRAGMENT = "PROFILE_LIST_FRAGMENT"
const val APP_VERSION_FRAGMENT = "APP_VERSION_FRAGMENT"

Expand All @@ -32,7 +33,7 @@ class AdministratorControlsActivity :
activityComponent.inject(this)
val extraControlsTitle = savedInstanceState?.getString(SELECTED_CONTROLS_TITLE_KEY)
lastLoadedFragment = if (savedInstanceState != null) {
savedInstanceState.get(LAST_LOADED_FRAGMENT_KEY) as String
savedInstanceState.get(LAST_LOADED_FRAGMENT_SAVED_KEY) as String
} else {
// TODO(#661): Change the default fragment in the right hand side to be EditAccount fragment in the case of multipane controls.
PROFILE_LIST_FRAGMENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ class AdministratorControlsActivityPresenter @Inject constructor(
if (titleTextView != null) {
outState.putString(SELECTED_CONTROLS_TITLE_KEY, titleTextView.text.toString())
}
outState.putString(LAST_LOADED_FRAGMENT_KEY, lastLoadedFragment)
outState.putString(LAST_LOADED_FRAGMENT_SAVED_KEY, lastLoadedFragment)
}
}

0 comments on commit e488310

Please sign in to comment.