-
[AOS] Can not perform this action after onSaveInstanceState2022. 10. 5. 21:52λ°μν
πͺ²
Fatal Exception: java.lang.IllegalStateException
Can not perform this action after onSaveInstanceState
λ°±κ·ΈλΌμ΄λ μνμ μ±μ΄ μΈμ νμμμ μ΄ν Activityμμ dismiss()λ₯Ό μνν λ λ°μνλ€.
ν΄κ²° λ°©λ²
dismiss() -> dismissAllowingStateLoss()
λ³κ²½ν΄μ£Όλ©΄ κ°λ¨νκ² μ€λ₯κ° ν΄κ²°λλ€.
곡μλ¬Έμ
dismissAllowingStateLoss()
version of dismiss() that uses FragmentTransaction.commitAllowingStateLoss().
commitAllowingStateLoss()
Like commit() but allows the commit to be executed after an activity's state is saved. This is dangerous because the commit can be lost if the activity needs to later be restored from its state, so this should only be used for cases where it is okay for the UI state to change unexpectedly on the user.
dismissAllowingStateLoss()λ FragmentTransaction.commitAllowingStateLoss()λ₯Ό μ¬μ©νλ dismiss() λ²μ μ΄λ€. commitAllowingStateLoss()μ νλμ μνκ° μ μ₯λ νμ 컀λ°μ μννλ€. μ¦, dismissAllowingStateLoss()λ νλμ μνκ° μ μ₯ λ ν dismiss()λ₯Ό μννλ€.
λ°μν'π° Android π > πͺ² λλ²κΉ ' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ