Re: [android-developers] Android memory allocation and static variables

2012-08-06 Thread Mark Murphy
On Mon, Aug 6, 2012 at 7:14 AM, Mario Bat wrote: > Ok...the problem is that if I unregister from GCM the app will still receive > notifications until GCM sets it to unregistered that can wait for 2-3 days. > Thats what i heard at least... > The only way I see here is to write it to a file if its r

Re: [android-developers] Android memory allocation and static variables

2012-08-06 Thread Mario Bat
Ok...the problem is that if I unregister from GCM the app will still receive notifications until GCM sets it to unregistered that can wait for 2-3 days. Thats what i heard at least... The only way I see here is to write it to a file if its registered or not, and when the push comes check in the

Re: [android-developers] Android memory allocation and static variables

2012-08-06 Thread Mark Murphy
No, when Android terminates your process, your static data members go away. A new process will be forked to run your app on the next message (or when the user launches your activity, or whatever), at which point your static data members will have their default values. On Mon, Aug 6, 2012 at 7:03 A

[android-developers] Android memory allocation and static variables

2012-08-06 Thread Mario Bat
Hi everyone, I am writing on an Android application where i am registering to GCM. When I click the cehckbox to register i want to set a static variable isRegistered to true/false. Now when i receive the message I want to check this variable and if it is true I make an notification. So when i ge