Generally, object variables placed in a class are not very stable. If you need to record content in the memory and require this data to be used in other activities, it is best not to put it in other classes. It should be defined When a class is destroyed is undefined. So if you need something recorded in memory, put it in the Application class. In addition, if persistence is required, use database, file, SharedPreference.
Generally, object variables placed in a class are not very stable. If you need to record content in the memory and require this data to be used in other activities, it is best not to put it in other classes. It should be defined When a class is destroyed is undefined. So if you need something recorded in memory, put it in the Application class.
In addition, if persistence is required, use database, file, SharedPreference.
Put frequently used variables in the Application. If persistence is required, put them in the database or SharedPreference.