1 回答

TA貢獻1807條經驗 獲得超9個贊
和是您的 firebase 數據庫中的值quantity,在您的類中它被聲明為. 這是拋出錯誤。像下面這樣聲明類。discountLongCartStringCart
public class Cart {
private String pid, pname, price;
private Long discount, quantity;
public Cart() {
}
public Cart(String pid, String pname, String price, Long discount, Long quantity) {
this.pid = pid;
this.pname = pname;
this.price = price;
this.discount = discount;
this.quantity = quantity;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getPname() {
return pname;
}
public void setPname(String pname) {
this.pname = pname;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public Long getDiscount() {
return discount;
}
public void setDiscount(Long discount) {
this.discount = discount;
}
public Long getQuantity() {
return quantity;
}
public void setQuantity(Long quantity) {
this.quantity = quantity;
}
}
希望能解決您的問題。
添加回答
舉報