|
|
|
@ -115,6 +115,20 @@ public class ActivityBilling extends ActivityBase implements
|
|
|
|
|
.setListener(this)
|
|
|
|
|
.build();
|
|
|
|
|
billingClient.startConnection(this);
|
|
|
|
|
getLifecycle().addObserver(new LifecycleObserver() {
|
|
|
|
|
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
|
|
|
|
|
public void onDestroyed() {
|
|
|
|
|
getLifecycle().removeObserver(this);
|
|
|
|
|
if (billingClient != null)
|
|
|
|
|
try {
|
|
|
|
|
Log.i("IAB end");
|
|
|
|
|
billingClient.endConnection();
|
|
|
|
|
billingClient = null;
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
/*
|
|
|
|
@ -180,14 +194,6 @@ public class ActivityBilling extends ActivityBase implements
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onDestroy() {
|
|
|
|
|
if (billingClient != null)
|
|
|
|
|
billingClient.endConnection();
|
|
|
|
|
|
|
|
|
|
super.onDestroy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
|
static String getSkuPro(Context context) {
|
|
|
|
|
if (isTesting(context))
|
|
|
|
|