• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps View Lifecycle and refresh when returning from activity

dustbyter

Lurker
Hi,

I've searched around before creating a new thread as I could not find my answer elsewhere.

My question is as follows. I'm writing an application for Android and have multiple Activities, there are three to be exact. When a user drills down to the record they would like to view, they can modify it.

The issues is that when I click the back button to move to the previous screen, i'd like to refresh it to reflect the update performed by the end user. I can't figure out how to hook onto the appropriate event and then refresh my data on that view.

Any tips or direction for this issue i'm having? I imagine it is an easy one, but I just came over from iOS and am still learning.

Regards.
 
Hi All,

Any help with my question would be greatly appreciated.

I've tried to see if the onResume() event is triggered, but it is not. I am having a hard time understanding what event would trigger and allow me to refresh the data.

Thanks!
 
onResume WILL be called whenever the Activity comes into the user's view (AKA the foreground). This is what you should be using to modify the Activity's state.
 
jonbonazza,

Thanks confirming onResume. I figured out the issue is that when I was building the project the .class files were stale and had not taken the updated code.
Once I manually removed the files from the directory then the application was rebuilt and the onResume method was kicked off.

Thanks!
 
Back
Top Bottom