我是android studio的新手,我想帮助我的代码.
bp.getPurchaseListingDetails(“YOUR PRODUCT ID FROM GOOGLE PLAY CONSOLE HERE”);
因此,它将是一个SkuDetails对象,包含以下信息:
public final String productId; public final String title; public final
String description; public final boolean isSubscription; public final
String currency; public final Double priceValue; public final String
priceText;
好的,所以我想得到,例如,产品价格,我正在尝试:
String price = bp.getPurchaseListingDetails(“productidname”).priceText;
pricevalue.setText(price);
它返回null.我做错了什么?
解决方法:
我知道已经很晚了,但下面是我的答案,对你有用.
在下面写下代码
public void onBillingInitialized() {
SkuDetails sku = bp.getPurchaseListingDetails(“YOUR PRODUCT ID FROM GOOGLE PLAY CONSOLE HERE”);
String price =sku.priceText;
}
我相信你的问题会得到解决.
标签:android,android-billing
来源: https://codeday.me/bug/20190608/1196130.html