anjlab / android-inapp-billing-v3

A lightweight implementation of Android In-app Billing Version 3
Other
2.19k stars 535 forks source link

getContext() from BillingBase is private #232

Closed Geodark closed 6 years ago

Geodark commented 7 years ago

Hi,

I am using your library and helped me to add IAB in my android app. I want to use the context to show a progress dialog when I am sending the purchase token to the server. Here is my code:

billingProcessor = new BillingProcessor(this, Constants.GOOGLE_LICENCE_KEY, new BillingProcessor.IBillingHandler() {

@Override
public void onProductPurchased(String productId, TransactionDetails details) {
progressDialog = ProgressDialog.show(billingProcessor.getContext(), "Loading...", "Subscription...");
...
}

Currently billingProcessor.getContext() is private and I was wandering If It can be public. Or there is another way to access the context in the implementation of onProductPurchased?

autonomousapps commented 6 years ago

BYOC (Bring Your Own Context)