I am searching for a possibility to store the user ID (received after login) in a way that all Activites have access to it.
If I understood it correctly a SharedPreference is only available for one specific Acitivty.
Which possibilites do I have to save the ID comprehensively?
Greetings,
oetzi
Applicationand access the data using the contextThose are for application states which will be non-persistent, meaning that they’re stored in memory and therefor will be lost, as soon as your application quits.
For persistent storage, use one of those.
SharedPrefferencesFor more ideas, see the Storage Options article from the Android Docs.