Fix inapp purchase methods in InAppActivity

This commit is contained in:
Margaux Clerc 2015-05-20 14:16:19 +02:00
parent ff64caaa8f
commit 51eb29d931

View file

@ -118,7 +118,7 @@ public class InAppPurchaseActivity extends Activity implements InAppPurchaseList
public void onClick(View v) { public void onClick(View v) {
Purchasable item = (Purchasable) v.getTag(); Purchasable item = (Purchasable) v.getTag();
if (v.equals(recoverAccountButton)) { if (v.equals(recoverAccountButton)) {
inAppPurchaseHelper.recoverAccount(item.getId(), getUsername()); inAppPurchaseHelper.recoverAccount(getUsername());
} else { } else {
inAppPurchaseHelper.purchaseItemAsync(item.getId(), getUsername()); inAppPurchaseHelper.purchaseItemAsync(item.getId(), getUsername());
} }
@ -150,6 +150,13 @@ public class InAppPurchaseActivity extends Activity implements InAppPurchaseList
}); });
} }
@Override
public void onActivateAccountSuccessful(boolean success) {
if (success) {
Log.d("[In-app purchase] Account activated");
}
}
private void displayBuySubscriptionButton(Purchasable item) { private void displayBuySubscriptionButton(Purchasable item) {
View layout = LayoutInflater.from(this).inflate(R.layout.in_app_purchasable, purchasableItemsLayout); View layout = LayoutInflater.from(this).inflate(R.layout.in_app_purchasable, purchasableItemsLayout);
TextView text = (TextView) layout.findViewById(R.id.text); TextView text = (TextView) layout.findViewById(R.id.text);