O objeto não faz parte do esquema deste Domínio
Assim que tento obter meu objeto do banco de dados do Realm, o aplicativo travou e recebo este erro:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.repdev.realtimedelijn/com.repdev.realtimedelijn.activity.MainActivity}:
java.lang.IllegalArgumentException: Haltes is not part of the schema for this Realm
Esta é a minha atividade onde acontece
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_main);
Context context = this;
View view = this.getWindow().getDecorView();
realm = Realm.getInstance(getRealmConfiguration());
RealmResults<Haltes> haltes = realm
.where(Haltes.class)
.findAll();
HaltesRecyclerViewAdapter haltesRecyclerViewAdapter =
new HaltesRecyclerViewAdapter(this, haltes, true, true);
RealmRecyclerView realmRecyclerView =
(RealmRecyclerView) findViewById(R.id.realm_recycler_view);
realmRecyclerView.setAdapter(haltesRecyclerViewAdapter);
}
e aqui está o modelo
Alguém uma idéia de como consertar isso? a classe pública Haltes implementa RealmModel {
@PrimaryKey
private long id;
private String halteNaam;
private String halteNummer;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getHalteNaam() {
return halteNaam;
}
public void setHalteNaam(String halteNaam) {
this.halteNaam = halteNaam;
}
public String getHalteNummer() {
return halteNummer;
}
public void setHalteNummer(String halteNummer) {
this.halteNummer = halteNummer;
}
}