So I'm making a mobile game and have multiple activities throughout my project. I have been passing variables from one activity to the next using Intents, and then passing these variables back to other activities. So, for example, if there is a value x = 5 in Activity1, that value would be passed into Activity2. Then, if the player changes x to 6 in Activity2, this information would be passed back into Activity1.
This method works, but it seems very inefficient. Is there any way to create a global variable for the entire project in such a way so when I change it in one activity, it changes in all the activities?
Thanks