android - Does bringing an activity to the foreground call its onCreate method? -


pretty self explanatory question. if start activity b activity , user subsequently presses or home, activity b destroyed , activity comes foreground. activity a's oncreate method guaranteed called? seems way me. wanted check.

no. when activity comes foreground guaranteed activity a's onstart() called. can put log.i() inside oncreate(), onstart() callbacks check yourself. but, if in low-memory, , gc, chance, clear savedinstancestate state of activity a, system needs call oncreate() again.

so based on internal condition of system, calls oncreate(), onstart(), or onresume(). nothing guaranteed.

enter image description here

you see above picture, arrow pointed oncreate(), onstart(), onpause().


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -