私はこのクラスhttps://gist.github.com/patloew/bc32a2a1a3c0097e9c7020192fb2c78fをレルムデータベースと共に使用しようとしていますが、動作させることができません。レルムとパーセルでCAP#1エラー
Error:(79, 100) error: incompatible types: RealmList<CAP#1> cannot be converted to RealmList<Day>
where CAP#1 is a fresh type-variable:
CAP#1 extends RealmObject from capture of ? extends RealmObject
:
は私が
@Parcel(implementations = { MonthRealmProxy.class },
value = Parcel.Serialization.BEAN,
analyze = { Month.class })
public class Month extends RealmObject {
RealmList<Day> days;
public RealmList<Day> getDays() {
return sessions;
}
@ParcelPropertyConverter(RealmListParcelConverter.class)
public void setDays(RealmList<Day> days) {
this.days= days;
}
}
のように見え、日が
@Parcel(implementations = { DayRealmProxy.class },
value = Parcel.Serialization.BEAN,
analyze = { Day.class })
public class Day extends RealmObject {
public int hours;
}
のように見えますが、私はこのエラーを取得し、コンパイル時に私が間違っているかわからないクラスを持っています
私はこれを理解することなく何時間も費やしてくれたので、何か助けてくれてありがとう。
RealmListのアダプターを作ったのですか?アダプタを作成していない場合は、次のコードを参照してください。https://gist.github.com/cmelchior/72c35fcb55cec33a71e1 – Dalinaum
アダプタ?だから、クラスがhttps://gist.githubusercontent.com/cmelchior/72c35fcb55cec33a71e1/raw/a9297b5ee8878c3046d3d728b1087975704e9f3d/BarListParcelConverter.javaとhttps://gist.githubusercontent.com/cmelchior/72c35fcb55cec33a71e1/raw/a9297b5ee8878c3046d3d728b1087975704e9f3d/RealmListParcelConverter置き換えるために使用されていません。 1つの一般的な単一クラスを持つJava? – Mackan
申し訳ありません。私はあなたのコードを誤解しました。 patloewのコードとあなたのモデルはOKと思われます。 [email protected]にあなたのコードを共有できますか? – Dalinaum