Skip to content

Tag: android-sqlite

i cant update value in SQLite

I have this table to sqlite: And this is my method to Update value: And i add a object variable in my activity: So, in activity I use this to change value using update method: But this not works because when I press the button: Class: Nothing happens because the value is (1) one all the time. What’s wro…

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 ke…