>
> If in activity 1 I initialize a static field to a value. Then lock the
> device on activity 5, I then return to my application 4 hours later, during
> which time the device reclaimed my application for memory. I then restore
> my app and am looking at activity 5, I then tap something and navigate to
> activity 6, once there the activity attempts to access the field
> initialized in activity 1, but since activity 1 hasn't ran since the
> application was restored I get a null reference exception.
>

That is really bad design... You should rethink how you are doing that.

I realize this is a bad technique
>

Then you should change it...

I want to be able to recreate application recycling in order to diagnose a
> similar issue, so that I may resolve it, but am unable to. Any ideas on how
> I can for application recycling, so that I can test this without having to
> wait 4 hours in between each test?
>

If you change your design then this problem will go away.  Rather than
trying to fix the symptoms of bad architecture design, you should focus on
the source of the problem, rather than trying to apply a band-aid solution
to the symptoms.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Sun, Mar 18, 2012 at 5:28 PM, Trey <[email protected]> wrote:

> Thank you all for your replies. I have tested each of my activities and
> their state saving using the rotate approach. But what I'm trying to test
> is the state of my entire application, not my activities.
>
> For example:
>
> If in activity 1 I initialize a static field to a value. Then lock the
> device on activity 5, I then return to my application 4 hours later, during
> which time the device reclaimed my application for memory. I then restore
> my app and am looking at activity 5, I then tap something and navigate to
> activity 6, once there the activity attempts to access the field
> initialized in activity 1, but since activity 1 hasn't ran since the
> application was restored I get a null reference exception.
>
> I realize this is a bad technique--and I want to be able to recreate
> application recycling in order to diagnose a similar issue, so that I may
> resolve it, but am unable to. Any ideas on how I can for application
> recycling, so that I can test this without having to wait 4 hours in
> between each test?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> 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-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
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-developers?hl=en

Reply via email to