mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-10 20:15:54 +00:00
Fix dialog crashes in StateDialogActivity
This commit is contained in:
parent
da9db849eb
commit
d925cbfdde
1 changed files with 4 additions and 6 deletions
|
@ -3,9 +3,7 @@ package com.nutomic.syncthingandroid.activities;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.databinding.DataBindingUtil;
|
import android.databinding.DataBindingUtil;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
@ -27,15 +25,15 @@ public abstract class StateDialogActivity extends SyncthingActivity {
|
||||||
private AlertDialog mDisabledDialog;
|
private AlertDialog mDisabledDialog;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onResume() {
|
||||||
super.onCreate(savedInstanceState);
|
super.onResume();
|
||||||
registerOnServiceConnectedListener(() ->
|
registerOnServiceConnectedListener(() ->
|
||||||
getService().registerOnApiChangeListener(this::onApiChange));
|
getService().registerOnApiChangeListener(this::onApiChange));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onPause() {
|
||||||
super.onDestroy();
|
super.onPause();
|
||||||
if (getService() != null) {
|
if (getService() != null) {
|
||||||
getService().unregisterOnApiChangeListener(this::onApiChange);
|
getService().unregisterOnApiChangeListener(this::onApiChange);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue