Created
May 12, 2017 10:42
-
-
Save parahall/38411f70b18170fce87f1e158bec520c 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
@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