-1

I am defining default database at the first run then calling the default database i don't why it is asking me to call setDefaultConfuration when i have already created default.realm file.
here is the declaration:-

      boolean isFirstRun = wmbPreference.getBoolean("FIRSTRUN", true);
if (isFirstRun) {

 RealmConfiguration config = new RealmConfiguration.Builder(context)
  .name(Realm.DEFAULT_REALM_NAME)
  .migration(new in.webic.sendify.Details())
  .schemaVersion(0)
  .build();
 realm = realm.getInstance(config);
 realm.close();

 SharedPreferences.Editor editor = wmbPreference.edit();
 editor.putBoolean("FIRSTRUN", false);
 editor.commit();

}
realm = Realm.getDefaultInstance();

i am not able to find what wrong i am doing? or there is an alternative way of declaration of realm database?
any help will be appritiated
Thanks

phpdroid
  • 1,642
  • 1
  • 18
  • 36

1 Answers1

1

Because you never called

Realm.setDefaultConfiguration(config);
EpicPandaForce
  • 79,669
  • 27
  • 256
  • 428