use of com.litekite.inappbilling.room.entity.BillingSkuDetails in project Android-InAppBilling by LiteKite.
the class BillingManager method storeSkuDetailsLocally.
/**
* Stores SKU Details on local storage.
*
* @param skuDetailsList list of SKU Details returned from the queries.
*/
private void storeSkuDetailsLocally(List<SkuDetails> skuDetailsList) {
final List<BillingSkuDetails> billingSkuDetailsList = new ArrayList<>();
for (SkuDetails skuDetails : skuDetailsList) {
BillingSkuDetails billingSkuDetails = new BillingSkuDetails();
billingSkuDetails.skuID = skuDetails.getSku();
billingSkuDetails.skuType = skuDetails.getType();
billingSkuDetails.skuPrice = skuDetails.getPrice();
billingSkuDetailsList.add(billingSkuDetails);
}
new Thread(new Runnable() {
@Override
public void run() {
AppDatabase.getAppDatabase(context).getBillingDao().insertSkuDetails(billingSkuDetailsList);
}
}).start();
}
Aggregations