我在第一次迭代后打破了for循环.我知道这样做并不好,但我不知道如何解决这个问题.我收到消息"for statement not loop".我正在使用android studio IDE.
List<PriceWithCurrency> commercialPrices = purchaseLineItem.getProduct().getCommercialPrices();
CrewSalesRecord crewSalesRecord =
new CrewSalesRecord(
purchase.getEmployeeIdentifier(),
purchaseLineItem.getQuantity());
crewSalesRecords.add(crewSalesRecord);
for (PriceWithCurrency currency : commercialPrices) {
ProductData purchaseData = new ProductData(
purchaseLineItem.getProduct().getProductId(),
purchaseLineItem.getProduct().getShortDescription(),
purchaseLineItem.getQuantity(),
crewSalesRecords, currency.getPrice());
uncombinedProductDataList.add(purchaseData);
break;
}
Run Code Online (Sandbox Code Playgroud)