mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 06:01:12 +00:00
Prevent crash
This commit is contained in:
parent
157bfbdf5a
commit
75e2a2a302
1 changed files with 5 additions and 2 deletions
|
@ -172,6 +172,10 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
|
|||
public void onBillingSetupFinished(@BillingClient.BillingResponse int responseCode) {
|
||||
String text = Helper.getBillingResponseText(responseCode);
|
||||
Log.i(Helper.TAG, "IAB connected response=" + text);
|
||||
|
||||
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||
return;
|
||||
|
||||
if (responseCode == BillingClient.BillingResponse.OK) {
|
||||
backoff = 4;
|
||||
queryPurchases();
|
||||
|
@ -186,8 +190,7 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
|
|||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!billingClient.isReady() &&
|
||||
getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||
if (!billingClient.isReady())
|
||||
billingClient.startConnection(billingClientStateListener);
|
||||
}
|
||||
}, backoff * 1000L);
|
||||
|
|
Loading…
Reference in a new issue