mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 01:36:55 +00:00
Prevent crash
This commit is contained in:
parent
7cc10f740d
commit
152e2dfb77
1 changed files with 3 additions and 1 deletions
|
@ -42,6 +42,7 @@ import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.lifecycle.Lifecycle;
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedListener {
|
abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedListener {
|
||||||
|
@ -180,7 +181,8 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!billingClient.isReady())
|
if (!billingClient.isReady() &&
|
||||||
|
getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
billingClient.startConnection(billingClientStateListener);
|
billingClient.startConnection(billingClientStateListener);
|
||||||
}
|
}
|
||||||
}, backoff * 1000L);
|
}, backoff * 1000L);
|
||||||
|
|
Loading…
Reference in a new issue