IllegalStateException : Cannot perform this action after onSaveInstanceState()

Many of you might have encountered this exception while working with fragments . The source for this issue can be different based on the use case but if you look under the hood this happens only because of one reason- mismanagement of Activity states. In this article we will be discussing the same. First we will explain what happens behind the scenes and what is source of this crash and then most importantly how to resolve it.

stack_trace.PNG

Continue reading

[Android Example] Best solution for Fragment IllegalStateException

Many of you might have encountered this exception while working with fragments . The source for this issue can be different based on the use case but if you look under the hood this happens only because of one reason- mismanagement of Activity states. In this article we will be discussing the same. First we will explain what happens behind the scenes and what is source of this crash and then most importantly how to resolve it.

stack_trace.PNG

Continue reading