How can you tell if an activity is starting or resuming?

Posted by Joren on Stack Overflow See other posts from Stack Overflow or by Joren
Published on 2010-06-10T01:42:08Z Indexed on 2010/06/10 2:02 UTC
Read the original article Hit count: 229

Filed under:
|
|

I have an activity which pulls some JSON from my server, and then uses it to draw a list. That list launches further activities.

My problem is that I can't figure out a way to tell if the activity is still alive when you go back to it, so I end up re-querying my JSON from the server and redrawing the list every time the user goes back to the activity.

How can I tell if my activity is still alive so I can skip the redraw?

Using onRestart works for hitting the home key then going back, but onCreate not onRestart is called if I selected a list item then hit back.

© Stack Overflow or respective owner

Related posts about java

Related posts about android