Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid In App Purchase Problems
    text
    copied!<p>I've implemented In App purchase in my account using static response id <code>android.test.purchased</code>. Now when purchase the item a <code>Toast</code> popups saying <strong>"Thank you. Your item will appear shortly."</strong></p> <p>I think so far every thing works perfectly.</p> <p>My problem is <li>Where does this <code>Toast</code> comes from. I couldn't find out it my code.</li> <li>How can I override this Toast? Is it because of the <code>Reserved product ID</code> I used? Will it change once I use my own product Ids?</li> <li>Which overridden function should be used know whether User has purchased or cancelled the request.</p> <pre><code> @Override public void onPurchaseStateChange(PurchaseState purchaseState, String itemId, long purchaseTime, String developerPayload) { if (purchaseState == PurchaseState.PURCHASED) { // Is it here? } } </code></pre> <p></li> <li>And finally, can I perform User Interface modifications within <code>onPurchaseStateChange</code>?</li></p> <p>Here's my <code>onPurchaseStateChange</code> methode</p> <pre><code> @Override public void onPurchaseStateChange(PurchaseState purchaseState, String itemId, long purchaseTime, String developerPayload) { if (Consts.DEBUG) { Log.i(TAG, "onPurchaseStateChange() itemId: " + itemId + " " + purchaseState); } if (purchaseState == PurchaseState.PURCHASED) { for (CatalogEntry e : CATALOG) { if (e.sku.equals(itemId) &amp;&amp; e.managed.equals(Managed.SUBSCRIPTION)) { } } } Toast.makeText(getApplicationContext(), "purchase failed", Toast.LENGTH_LONG).show(); } </code></pre> <p>Any help would be greatly appreciated! :) Thank you!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload