i want to buy same item over and over but code gives me null pointer exception when try to buy second time.
Here is the code;
try {
Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(), "ucret", "inapp", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
} catch (RemoteException e) {
e.printStackTrace();
} catch (IntentSender.SendIntentException e) {
e.printStackTrace();
}
When this code script works again pendinIntent coming null.
We can ask to google if user has already purchased like above code
inventory.hasPurchase(sku_id);
But I want to sell same item whenever i open the screen.
Thanks for helping.