Created
November 26, 2019 08:17
-
-
Save abbas-oveissi/8314028c31a5e89e9b9ef3308eda2beb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void isUserBuyStreaming() { | |
if (!isCafeInstalled()) { | |
Toast.makeText(this, R.string.cafebazaar_isnot_installed_error, Toast.LENGTH_SHORT).show(); | |
return; | |
} | |
mHelper.queryInventoryAsync(new IabHelper.QueryInventoryFinishedListener() { | |
public void onQueryInventoryFinished(IabResult result, Inventory inventory) { | |
if (result.isFailure()) { | |
Toast.makeText(DetailActivity.this, R.string.query_inventory_error, Toast.LENGTH_SHORT).show(); | |
return; | |
} | |
if (inventory.hasPurchase(SKU_STREAMING)) { | |
openPlayer(); | |
} else { | |
buyStreaming(); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment