My scenario of In App Billing implementation: 1. The Home screen shows the list of products which I am planning to sell. 2. The detail screen (Screen shown on selecting a li
In the Dungeons example, if you make a RESTORE_TRANSACTION request the response from the server will first call this function:
onPurchaseStateChange(PurchaseState purchaseState, String itemId, int quantity, long purchaseTime, String developerPayload)
and then: onRestoreTransactionsResponse(RestoreTransactions request,ResponseCode responseCode)
Restore transactions should not be done frequently, possibly only on the app's first run (so you can restore purchases if the user reinstalled the app, etc.) You don't need it for purchasing a product.
The BillingService
offers separate methods for requesting a purchase and restoring transactions. Just call the appropriate one from the relevant activity. You only need one purchase observer, it doesn't matter how UI/activities are structured.