There is a lot of examples and guides how to get ApplicationContext, but a cannot find some examples which provide me an ability to store some values in ApplicationContext.
I want to get, for example, string mode everywhere in my application, like this:
String mode = getApplicationContext().getMode();
How can I do that?
You have to extend
Application(there is noApplicationContextclass) and add the fields you need stored to your custom class. Then you would cast the reference you get fromgetApplication()to your actual class: