This is some code in my Android App:
public class Offer extends RealmObject {
@PrimaryKey
private long id;
}
In my service class:
RealmList<Offer> currentLocalMerchantOfferList = currentLocalMerchant.getOffers();
RealmList<Offer> findIncomingMerchantOfferList = findIncomingMerchant.getOffers();
if (!EqualsUtil.areEqual(currentLocalMerchantOfferList, findIncomingMerchantOfferList)) {
currentLocalMerchant.setOffers(findIncomingMerchantOfferList == null ? null : realm.copyToRealmOrUpdate(findIncomingMerchantOfferList));
}
I get compile error:
error: incompatible types: bad type in conditional expression
currentLocalMerchant.setOffers(findIncomingMerchantOfferList == null ? null : realm.copyToRealmOrUpdate(findIncomingMerchantOfferList));
Am I using copyToRealmOrUpdate correctly? If not, how do you use it correctly?