In my app I have done the below code in the dungeons sample project to check whether the item is purchased or not and changing my text of a list item :
@Override
public void onPurchaseStateChange(PurchaseState purchaseState,
String itemId, int quantity, long purchaseTime,
String developerPayload) {
if (Consts.DEBUG) {
Log.i("Tag", "onPurchaseStateChange() itemId: " + itemId + " "
+ purchaseState);
}
if (purchaseState == PurchaseState.PURCHASED) {
ownedItems.add(itemId);
list.get(purchaseposition).setPurchase("Play");
adapter.notifyDataSetChanged();
}
// YOU can also add other checks here
}
but when I re run the application it can not remember that I have already bought the item and it prompt me to buy it again. How can i do this? Its looking a little bit of complicated for me.