Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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