Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old October 26th, 2012, 05:01 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2012
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default View Lifecycle and refresh when returning from activity

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.

Advertisements
dustbyter is offline  
Reply With Quote
sponsored links
Old October 28th, 2012, 10:36 AM   #2 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2012
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!
dustbyter is offline  
Reply With Quote
Old October 28th, 2012, 08:04 PM   #3 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

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.
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is offline  
Reply With Quote
Old November 5th, 2012, 02:52 PM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2012
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!
dustbyter is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 01:39 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.