I would like to use a class and its class variables as a global “cache” for my globally used variables.
I need to ensure that it never gets unloaded during the app livecycle and loses its values.
How can I ensure that the class never gets unloaded?
This is how the class is declared:
public class GlobalVars {
public static Integer gi1;
public static WebiDBAdapter gDBAdapter;
}
Many thanks!
Use the Application class
To use it in your activities :