How avoid to register multiple network broadcast receivers in Android : I have a problem with registration network broadcast receiver. As no one was using android 7.0 in this app it was all right because I declared this broadcast in manifest. Right now, I must register broadcast receiver in my config activity after clicking save button. But when somebody clicked few times this button, then he register a lot of network services. The problem is that the service must work in the background and intercept situations when the internet appears when the application is not open.

    networkService = new NetworkService();
                if (!isReceiverRegistered(networkService)) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                        getActivity().registerReceiver(networkService, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
                        receivers.add(networkService);
                    }
                }

Right now, I already have this broadcast receiver in Manifest and I already activate him after click in save button.

    <receiver android:name=".services.NetworkService"
                      android:enabled="true"
                      android:exported="true">
                <intent-filter android:priority="999">
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <action android:name="android.intent.action.QUICKBOOT_POWERON" />
                    <action android:name="android.intent.action.PACKAGE_REPLACED" />
                    <action android:name="android.intent.action.PACKAGE_ADDED" />
                    <action android:name="android.intent.action.REBOOT"/>
                    <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </receiver>

