Fix crash if purchase service not available
This commit is contained in:
parent
82d804587a
commit
d8913ef63a
1 changed files with 6 additions and 4 deletions
|
@ -298,6 +298,7 @@ public class InAppPurchaseHelper {
|
|||
|
||||
if (buyIntentBundle != null) {
|
||||
PendingIntent pendingIntent = buyIntentBundle.getParcelable(RESPONSE_BUY_INTENT);
|
||||
if (pendingIntent != null) {
|
||||
try {
|
||||
((Activity) mContext).startIntentSenderForResult(pendingIntent.getIntentSender(), ACTIVITY_RESULT_CODE_PURCHASE_ITEM, new Intent(), 0, 0, 0);
|
||||
} catch (SendIntentException e) {
|
||||
|
@ -305,6 +306,7 @@ public class InAppPurchaseHelper {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void purchaseItemAsync(final String productId, final String sipIdentity) {
|
||||
new Thread(new Runnable() {
|
||||
|
|
Loading…
Reference in a new issue