I have been trying to create an Object of ViewModel in an Activity but ViewModelProviders is deprecated So what\'s the alternative to create the ViewModel\'s object.
The simple option for the next several months is to stick with stable or beta versions. ViewModelProviders is only deprecated starting with 2.2.0, presently in an alpha03 release.
For when you do move to 2.2.0 or higher of the lifecycle dependencies, your options depend on your language:
If you are using Java, use the ViewModelProvider() constructor, passing in your activity or fragment
If you are using Kotlin, there is supposed to be a by viewModels() property delegate, though I am not finding it in the source code...