我試着使用領域來保存這個對象,但我得到這個錯誤我怎麼能保存的ArrayList <LatLng> savedPath在RealmObject
Error:(24, 9) error: Type java.util.ArrayList of field savedPath is not supported
這裏是我的代碼:
public class TrackingInfo extends RealmObject {
private int order_id;
private double savedDistance;
private double savedDuration;
private ArrayList <LatLng>savedPath;
public int getOrder_id() {
return order_id;
}
public void setOrder_id(int order_id) {
this.order_id = order_id;
}
public double getSavedDistance() {
return savedDistance;
}
public void setSavedDistance(double savedDistance) {
this.savedDistance = savedDistance;
}
public double getSavedDuration() {
return savedDuration;
}
public void setSavedDuration(double savedDuration) {
this.savedDuration = savedDuration;
}
public ArrayList<LatLng> getSavedPath() {
return savedPath;
}
public void setSavedPath(ArrayList<LatLng> savedPath) {
this.savedPath = savedPath;
}
public TrackingInfo(){}}
Thanx提前
我認爲你需要使用列表(領域類)和經緯度應RealmObject或類似的東西 – zombie
但我使用Android經緯度,所以我不能讓它擴展realmObject,它是不可編輯 – alsalimi
有一些支持的類型除了需要創建它的RealmObject之外,請檢查https://realm.io/docs/swift/latest/api/Classes/Object.html – zombie