@Module public class AppModule { | |
private Application application; | |
public AppModule(Application application) { | |
this.application = application; | |
} | |
@Provides @Singleton Context providesAppContext() { | |
return application.getApplicationContext(); | |
} | |
@Provides @Singleton AppDatabase providesDatabase(Context context) { | |
return Room.inMemoryDatabaseBuilder(context, AppDatabase.class).build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment