when I declare and initialize a variable as static in my main activity and the activity gets destroyed. Can I still access the content of the variable?
For example t
Static variables or static blocks are not associated with object. These are class level variable not object associated. If we destroy object, static variable will not destroy which is defined in same class. Static variable initialize once in memory.
so when we close app objects destroy but static variable not destroy. But when we clear app then class destroy and so static variable also. Sometime android kill class due to free memory space in that case static variable destroy.