On Mon, Apr 11, 2011 at 8:19 PM, Cranke <[email protected]> wrote:
> I noticed a strange problem with one of my apps. After a task kill (via, > say, a task killer app) and a restart of the app, the public static class > variables seem to get reset to null. > This is not a "strange problem". This is "expected behavior". > Can someone explain why this happens? > And, better yet, a way to work around it? > Search this group for "static null" or something. This comes up a lot. > ............... > // Check if our static is still non-null. > // How can it be null when the only way to get to SubActivity is > // through StaticTest, and StaticTest initializes > // StaticTest.ourStatic to be non-null? > That is not the only way to get to SubActivity. Review the lifecycle documentation to see why not. ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- 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

