Hello devs.
I need some advice regarding some implementation details.
N.B: There is an NDA regarding sharing product specifics so my description of the implementation might be blurry to everyone.
I am working on a product where users of an Android application can perform an app-wide state switch between entities of the same type.
To put things in more context, sort of the way you can switch users on windows or the way you can switch workspaces on Slack and your app knows which workspace is selected across all the screens in your app.
Currently, I am using a singleton to persist the currently selected workspace/user (in relation to the context I provided above) as it changes based on user actions and making it available app-wide.
I feel there is a better way to approach this. I have also researched things like state machines, an app-wide ViewModel to name a few.
I don't think there is a state management solution specifically for Android like Redux, Riverpod etc.
I believe this will affect product scalability, so my question is, what can I do to improve the implementation?