I make in-app purchases such as TrivialDrive. Call queryInventoryAsync:
mHelper.queryInventoryAsync(mGotInventoryListener);
mGotInventoryListener:
IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
String price = inventory.getSkuDetails(SKU_ALL_INCLUSILE).getPrice();
Log.d("SKU", "price " + price);
}
};
OnClick works great and I can make a purchase. But the getPrice () method creates an NPE. Help me please! I want to show SKU information in a ListView.
DECIDE! Just use:
mHelper.queryInventoryAsync(true, skuList, mGotInventoryListener);
source
share