Working Configuration....
Opened this issue · 3 comments
AndreiD commented
The documentation on the readme file results is not working. Here's the "config" that I use and works.
import android.app.Application;
import android.content.Context;
import com.facebook.stetho.Stetho;
import com.uphyca.stetho_realm.RealmInspectorModulesProvider;
import io.realm.Realm;
import io.realm.RealmConfiguration;
import java.util.regex.Pattern;
public class BaseApplication extends Application {
@Override public void onCreate() {
super.onCreate();
initializeStetho(this);
//------ init the db ----------------
RealmConfiguration config = new RealmConfiguration.Builder(this).deleteRealmIfMigrationNeeded().name("TheDb.realm").build();
Realm.setDefaultConfiguration(config);
}
private void initializeStetho(final Context context) {
Stetho.initialize(Stetho.newInitializerBuilder(context)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(context))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(context)
.withDescendingOrder()
.withLimit(1000)
.databaseNamePattern(Pattern.compile(".+\\.realm"))
.build())
.build());
}
}
AndreiD commented
if anyone has the same trouble as me... and doesn't want to spend 30min for this...