i think you're misunderstood how viewmodel works in android. viewmodel class is automatically initialized when onCreate of your activity is called. and will live as long as onDestroy is not called. so if your activity / fragment already uses a viewmodel, and you want to set a button onClickListener, the viewmodel is already been created, and you can just use the viewmodel's method inside your button onClickListener