android · android/IllegalStateException
IllegalStateException
IllegalStateException
Thrown when an operation is invalid for the current lifecycle state. Common Android sources: committing a Fragment transaction after onSaveInstanceState (use commitAllowingStateLoss() cautiously), calling getActivity() from a detached Fragment, or accessing a destroyed Activity context.
Also defined in
- java IllegalStateException Thrown when a method is invoked at an inappropriate time relative to the object's state, for example calling Iterator.remove() before Iterator.next().
- kotlin IllegalStateException Thrown to signal that a method was called when the object is in an inappropriate state for that operation. Also thrown by the check() and checkNotNull() standard library functions.
- scala IllegalStateException Thrown when a method is called and the object is in an inappropriate state for that operation. Scala Builder-pattern classes use this for state violations.