Created
January 12, 2021 16:25
-
-
Save NitinPraksash9911/84af2b861bc2d0616a2543390d131f2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestViewModel(application: Application) : AndroidViewModel(application) { | |
private var dataLiveData = MutableLiveData<Int>() | |
var data = dataLiveData as LiveData<Int> | |
private val roomDb = RoomDb.getInstance(application).getUserDao() | |
fun insertUser(user: User) { | |
roomDb.insertUser(user) | |
} | |
fun deleteUser() { | |
roomDb.deleteUser() | |
} | |
.. | |
.. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment