Guest User

Untitled

a guest
Jul 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. RealmConfiguration.Builder builder = new RealmConfiguration.Builder();
  2. builder.schemaVersion(SCHEMA_VERSION); // SCHEMA_VERSION = 1
  3. builder.migration(new Migration());
  4.  
  5. Realm.setDefaultConfiguration(builder.build());
  6. Realm.getDefaultInstance().close();
  7.  
  8. builder.schemaVersion(SCHEMA_VERSION); // SCHEMA_VERSION = 1
  9.  
  10. DynamicRealm dynamicRealm = DynamicRealm.getInstance(Realm.getDefaultConfiguration());
  11. long version = dynamicRealm.getVersion();
  12. dynamicRealm.close();
Add Comment
Please, Sign In to add comment