mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-20 19:05:32 +00:00
Prevent crash
This commit is contained in:
parent
cfd0736037
commit
d8d61ef159
1 changed files with 6 additions and 0 deletions
|
@ -544,11 +544,17 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
|
||||||
pgpService = new OpenPgpServiceConnection(getContext(), pkg, new OpenPgpServiceConnection.OnBound() {
|
pgpService = new OpenPgpServiceConnection(getContext(), pkg, new OpenPgpServiceConnection.OnBound() {
|
||||||
@Override
|
@Override
|
||||||
public void onBound(IOpenPgpService2 service) {
|
public void onBound(IOpenPgpService2 service) {
|
||||||
|
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
|
return;
|
||||||
|
|
||||||
tvOpenPgpStatus.setText("Connected to " + pkg);
|
tvOpenPgpStatus.setText("Connected to " + pkg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
|
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
|
return;
|
||||||
|
|
||||||
if ("bindService() returned false!".equals(ex.getMessage()))
|
if ("bindService() returned false!".equals(ex.getMessage()))
|
||||||
tvOpenPgpStatus.setText("Not connected");
|
tvOpenPgpStatus.setText("Not connected");
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue