Skip to content
Advertisement

Tag: viewmodel

AndroidViewModel has no zero argument constructor. How to solve this?

I’ve searched for my problem nearly whole the Internet and couldn’t find the answer, which I need. Yes. My question is not unique, but there was no answer, which could help me. So I decided to ask it myself. Now about the problem: …………………………………….. …………. Error: I tried to add a constructor with no arguments in class AuthActivityViewModel, but got

MVVM – get context in a Model class

I’m using MVVM to build my Android app and I need to connect the Model to a DB. Instead of Room I’m using the SQLiteOpenHelper and to make a connection to the DB I need the context. But since this is a non activity class I’m struggling to get it. My current solution looks as follows but I keep getting

Advertisement