mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
cc5dc26844
commit
84cfc8472b
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue