in-app-purchases-subscription
in-app-purchases-subscription copied to clipboard
Im not using recylerView Im just using Grid Layout for button for subscriptions.
Im not using recylerView Im just using Grid Layout for button for subscriptions. it has been succesfull but i want getPrice of product and set it as text in textview please help
Hi, sorry for the super late reply, i was held up so bad.
Please check the following code:
this is in showProduct() method. `` billingClient.queryProductDetailsAsync(params, (billingResult, list) -> { productDetailsList.clear(); handler.postDelayed(() -> { loadProducts.setVisibility(View.INVISIBLE); // productDetailsList.addAll(list); - this is where you add the list of products into productDetailsList List
Here I used a recyclerviewer but I removed it and replaced it with the following code.
ProductDetails currentItem = **productDetailsList**.get(position);
List<ProductDetails.SubscriptionOfferDetails> **subDetails** = currentItem.getSubscriptionOfferDetails();
Then number to get the price do this:
price = **subDetails**.get(0).getPricingPhases().getPricingPhaseList().get(0).getFormattedPrice();
}, 2000);
});
``