I am confused about a scenario where there are cou...
# android
s
I am confused about a scenario where there are couple of activities put together, but I want to have single viewmodel for each of the activities instead of keeping each activity with their individual viewmodel. What are pros and cons with this approach?
google 1
g
what do you mean with “put together”?
s
In an application, suppose A,B,C are activity and A launches B, B launches C. "put together" i meant in an app...
m
Separation of concerns comes to my mind first
💯 1
Next issues with lifecycles
k
Also if they’re using the same viewmodel it’s a code smell they should be fragments not activities, since the concept behind an activity is that it’s a completely separate thing, and if they have a shared VM then that implies they’re actually tightly interwoven and relate to the same process/activity
👍 1
2
s
@kyleg Thanks