Android - where to keep global data?
问题 I have several 2D and 3D arrays that I'd like to access from multiple places within my app, which will be loaded from SharedPreferences as strings when my app starts and saved back to SharedPreferences whenever onPause() is called on any activity. It's too tedious to pass them between activities with intents or bundles. Is there any way to store data globally in Android? 回答1: What we have done, is used a Globals class that uses mostly static fields and static methods, though not all are