Pradeep Pradeep - 1 year ago 170
Android Question

onRestart -> onStart() what happen between this 2 state

I've 2 Activity A & B.. A starts B when i return from B to A onRestart() is called, then onStart() method is called.
My question is all the views in Activity A redraws when onRestart() -> onStart()?

Answer Source
  • Just onResume(.) is called if Activity A is not yet destroyed (variables are retained, no redraw).
  • If it's destroyed onCreate(.) > onStart(.) > onResume(.) is called(variables are lost, redraw).
  • If it's stopped onRestart(.) > onStart(.) > onResume(.) is called(variables are not lost, redraw)

Thus you'll only loose variables if the Activity is cleared from memory.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download