hope you all would be fine... i am developing a simple app for testing and learning purposes that stores the name, email and image of the user into the ROOM DATABASE. i am a newbie to Room database i watched many tutorials on youtube to learn that how to implement ROOM in android apps. the main problem is that in Tutorials all of them are using AsyncTask to store info into ROOM. but when i followed those tutorials then i came to know that the AsyncTask has been deprecated, which is the main cause that i am not getting MyDatabase.getInstance() method inside my MainActivity. So tell me what to do right now.. what should i implement other than AsyncTask. Also i want to learn that how to store Images into RoomDatabase This is my Code where i am getting the error...
class InsertAsyncTask extends AsyncTask<User, Void, Void> {
@Override
protected Void doInBackground(User... users) {
//this is the line where i am getting the error. getInstance method becomes red.
//UserDatabase.getInstance(getApplicationContext()).dao().insertUser(users[0]);
return null;
}
}