Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Norbert515
Created March 5, 2018 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Norbert515/d32b3445aadf122f4a480b1c21df6707 to your computer and use it in GitHub Desktop.
Save Norbert515/d32b3445aadf122f4a480b1c21df6707 to your computer and use it in GitHub Desktop.
singleton
class Repository {
static final Repository _repo = new Repository._internal();
BookDatabase database;
static Repository get() {
return _repo;
}
Repository._internal() {
database = BookDatabase.get();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment