Commit a20f583d authored by Thomas's avatar Thomas
Browse files

Fix issue #1125 - Crash when changing the type of notifications

parent efbfbfbc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -35,9 +35,6 @@ import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceScreen;

import org.unifiedpush.android.connector.UnifiedPush;
import org.unifiedpush.android.connector.internal.Store;

import java.util.ArrayList;
import java.util.List;

import app.fedilab.android.R;
@@ -249,8 +246,11 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
        if (getActivity() != null) {
            if (key.compareToIgnoreCase(getString(R.string.SET_NOTIFICATION_TYPE)) == 0) {
                createPref();
                String type = sharedPreferences.getString(key, "");
                if(type.equals("PUSH_NOTIFICATIONS")) {
                    PushHelper.startStreaming(requireActivity());
                }
            }
            if (key.compareToIgnoreCase(getString(R.string.SET_NOTIFICATION_DELAY_VALUE)) == 0) {
                createPref();
                PushHelper.setRepeat(requireActivity());