fix crash in EditProfileActivity

main
Conny Duck 6 years ago
parent 716cf0667b
commit a41078ce72
  1. 12
      app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.kt

@ -59,6 +59,8 @@ class EditProfileActivity : BaseActivity(), Injectable {
private const val HEADER_PICK_RESULT = 2
private const val PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 1
private const val MAX_ACCOUNT_FIELDS = 4
private const val BUNDLE_CURRENTLY_PICKING = "BUNDLE_CURRENTLY_PICKING"
}
@Inject
@ -78,6 +80,11 @@ class EditProfileActivity : BaseActivity(), Injectable {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
savedInstanceState?.getString(BUNDLE_CURRENTLY_PICKING)?.let {
currentlyPicking = PickType.valueOf(it)
}
setContentView(R.layout.activity_edit_profile)
viewModel = ViewModelProviders.of(this, viewModelFactory)[EditProfileViewModel::class.java]
@ -170,6 +177,11 @@ class EditProfileActivity : BaseActivity(), Injectable {
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
outState.putString(BUNDLE_CURRENTLY_PICKING, currentlyPicking.toString())
}
override fun onStop() {
super.onStop()
if(!isFinishing) {

Loading…
Cancel
Save