Maybe do the commit in onPause ()?

Here's a warning about onStop:

*Note that this method may never be called, in low memory situations where 
the system does not have enough memory to keep your activity's process 
running after its onPause() method is called.*



On Wednesday, October 24, 2012 8:15:24 PM UTC-5, Virgílio Santos wrote:
>
> Hello, 
>
> I have two activities A and B in some app. On B, I save some data on 
> shared preferences (Configurations); on the other one, A, I use this 
> configuration data. I'm having some trouble when I change some data on 
> B and when I press back button and return to A the old data is 
> present. 
>
> I save the data on the onStop method of B and load it on the onResume 
> of A and I know that the data is correctly saved because if I switch 
> to a C activity (form my app or not) when I come back to A the correct 
> data is displayed. 
>
> So that, I believe that the commit is not yet complete when the 
> onResume A method runs and it takes the old data or there some sort of 
> cache on the SharedPreferences or I'm missing something on the 
> workflow. 
>
> Someone has any idea of what is happening or have already ran in such 
> kind of error? 
>
> Thanks in advance! 
>
> -- 
> Deserve's Got Nothing To Do With It 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/android-discuss/-/-eotEP0Z1VgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

Reply via email to