Skip to content

Instantly share code, notes, and snippets.

@ccjeng
Created September 11, 2016 12:43
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 ccjeng/67cbf95cc0061220b3289a65837f3f1c to your computer and use it in GitHub Desktop.
Save ccjeng/67cbf95cc0061220b3289a65837f3f1c to your computer and use it in GitHub Desktop.
deleteRealmIfMigrationNeeded
import android.app.Application;
import io.realm.RealmConfiguration;
public class MyApplication extends Application {
public static RealmConfiguration realmConfiguration;
@Override
public void onCreate() {
super.onCreate();
realmConfiguration = new RealmConfiguration.Builder(this)
.deleteRealmIfMigrationNeeded() //Force recreate realm objects if migration needs (for developer mode)
.build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment