Created
September 11, 2016 12:43
-
-
Save ccjeng/67cbf95cc0061220b3289a65837f3f1c to your computer and use it in GitHub Desktop.
deleteRealmIfMigrationNeeded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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