Reputation: 123
I followed this guide, and at the middle of the guide I came across this method:
public void buyClick(View view) {
mHelper.launchPurchaseFlow(this, ITEM_SKU, 10001,
mPurchaseFinishedListener, "mypurchasetoken");
}
I needed to copy it to my app code, and for some reason, the mPurchaseFinishedListener (I am using Android Studio) was red (means that there is an error).
when I hovered the mPurchaseFinishedListener with the mouse, Android studio said "Cannot resolve simbol 'mPurchaseFinishedListener'".
Now obviously I am doing something wrong, can somebody please help me?
THANK YOU
Upvotes: 1
Views: 351
Reputation: 32780
Have you implemented the IabHelper.OnIabPurchaseFinishedListener
as suggested in the tutorial you linked?
IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener
= new IabHelper.OnIabPurchaseFinishedListener() {
public void onIabPurchaseFinished(IabResult result,
Purchase purchase)
{
if (result.isFailure()) {
// Handle error
return;
}
else if (purchase.getSku().equals(ITEM_SKU)) {
consumeItem();
buyButton.setEnabled(false);
}
}
};
Upvotes: 1