Static variables are created and initialized when the class containing them is loaded into the VM by the class loader. When the class is unloaded or the VM ended, the static variables go "poof". There is generally no need to clear them.
I suppose if you wanted to you could clear them in an onTerminate() method (in the application) or an onDestroy() method (in an activity), but there isn't much point in doing so, and there's no guarantee that either of those two methods will be called. If you're for some reason paranoid about the variables not being cleared when created (a serious violation of the VM's "contract"), you could clear them in an onCreate() method. On Aug 31, 12:24 pm, siva <sivaraj.r...@gmail.com> wrote: > Hi Friends, > > I have used some static variable in my application, i want to clear > static variable value when will i close my application.anybody know > please give solution for that > > Thanks All -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en