Skip to content

Instantly share code, notes, and snippets.

@MaryKuz
Created March 27, 2019 09:20
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 MaryKuz/a8711eeebd87067307a45a7774135b90 to your computer and use it in GitHub Desktop.
Save MaryKuz/a8711eeebd87067307a45a7774135b90 to your computer and use it in GitHub Desktop.
Realm database initialization
public class SimpleRealmApp extends Application {
private static SimpleRealmApp instance;
@Override
public void onCreate() {
super.onCreate();
instance = this;
RealmConfiguration config = new RealmConfiguration.Builder(getApplicationContext()).setModules(new SimpleRealmModule()).build();
Realm.setDefaultConfiguration(config);
}
public static SimpleRealmApp getInstance() {
return instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment