I have an app in which the user is allowed to sign-in. The user data is saved in the database. The MainActivity implements an interface OnUserCreationCallback:
class MainActivity implements OnUserCreationCallback {
//Unrelated code
@Override
void setUser(boolean created) {
if(created) {
//Display welcome message
}
}
}
Once the user is created in the database, the setUser() method fires and the user gets a welcome message. This is working as expected. My question, is there any real benefit of implementing a ViewModel and a LiveData, that can be observed when the user is created? I'm talking only for this particular operation and not for an operation that changes multiple time. It's a one time operation.