I've sometimes posted about configuration changes, screen rotations and etc, but now I will write about a mistake that I made at the beginning when this handling involves Activity and Fragments. Let's take as example a simple Activity with a Fragment. We have to handle the configuration changes of the activity and the fragment and … Continue lendo Tip about the Handling Configuration Changes in a Relationship between Activities and Fragments
Tag: life cycle
Can not perform this action after onSaveInstanceState
I've faced this problem sometimes but I've never written about it. It's very interesting because it proves that the Android avoid at all costs lose the state of the activity. This error commonly happens when you try to commit a fragment transaction after the onSaveInstanceState() be called, in other words, when you do it in … Continue lendo Can not perform this action after onSaveInstanceState
Saving Instance State…again
I've posted sometimes about save instance state on activities (in portuguese), but I could observe that I've writen that Android OS can kill your process when it needs memory, so the activity can be destroyed anytime. I've written too that when it happens Android will give a chance to developers finish any threads or connections … Continue lendo Saving Instance State…again
O método onPause() do Ciclo de Vida de uma Activity
Ainda lendo o livro que comentei no meu último post, um trecho me lembrou de um ponto muito importante sobre o método onPause() que faz parte do ciclo de vida de uma Activity e que muita das vezes não damos o devido valor. "É importante saber que onPause() é sua última oportunidade para limpar e … Continue lendo O método onPause() do Ciclo de Vida de uma Activity