Notification access and lockscreen confliction?

So at the moment I’m making this app where when the user locks their phone then opens it back up a bordered image appears in place of the standard lockscreen. That works fine.
Then I have an option for it change an image on the app interface itself when a notification pops up. This works too.

My problem is that they don’t work together, one will work but the other won’t if that all makes sense. Anyone have any idea why this is?

EDIT:
This is the main activity class here

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);
    //If the notification service is enabled don't do anything, if it's not go to the option
    if(!isNotificationServiceEnabled()) {
        buildNotificationServiceAlertDialog = buildNotificationServiceAlertDialog();
        buildNotificationServiceAlertDialog.show();
    }

    requestWriteSettingPermission();
    //Permissions ----------------

    Button button = (Button) findViewById(R.id.privacy_policy_button);
    button.setPaintFlags(button.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    button.setText("Privacy Policy & Terms of Use");


    timeSpinner = (MaterialSpinner) findViewById(R.id.activity_main_time_spinner);
    timeSpinner.setItems(time_arrays);
    timeSpinner.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener<String>() {

        @Override public void onItemSelected(MaterialSpinner view, int position, long id, String item) {
            onTimeDurationChanged(position);
        }
    });


    ButterKnife.bind(this);

    //Lockscreen service button check

    if (MainActivity.isServiceRunning(this, LockScreenService.class)){
        onOffToggleButton.setChecked(true);
    }else{
        onOffToggleButton.setChecked(false);
    }


    opacitySeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            //Offset set opacity so the user can never make the shape impractically dim
            onOpacityChanged(progress + OPACITY_OFFSET);
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {

        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {

        }
    });


    //Notifys the activity when a notification is sent in
    imageChangeBroadcastReceiver = new ImageChangeBroadcastReceiver();
    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction("com.screenoflight.android2.NotificationService");
    registerReceiver(imageChangeBroadcastReceiver, intentFilter);

}

This is the new code I added for the notification stuff

private boolean isNotificationServiceEnabled(){
    String pkgName = getPackageName();
    final String flat = Settings.Secure.getString(getContentResolver(),
            ENABLED_NOTIFICATION_LISTENERS);
    if (!TextUtils.isEmpty(flat)) {
        final String[] names = flat.split(":");
        for (int i = 0; i < names.length; i++) {
            final ComponentName cn = ComponentName.unflattenFromString(names[i]);
            if (cn != null) {
                if (TextUtils.equals(pkgName, cn.getPackageName())) {
                    return true;
                }
            }
        }
    }
    return false;
}

private void updateNotification(int notificationCode)
   {
       switch(notificationCode)
       {
           case NotificationService.InterceptedNotificationCode.FACEBOOK_CODE:
               shapeRectangleButton.setImageResource(R.drawable.toggle_on);
               break;
           case NotificationService.InterceptedNotificationCode.OTHER_NOTIFICATIONS_CODE:
               shapeRectangleButton.setImageResource(R.drawable.toggle_on);
               break;
       }
   }`


public class ImageChangeBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        int receivedNotificationCode = intent.getIntExtra("Notification Code",-1);
        updateNotification(receivedNotificationCode);
    }
}


/**
 * Build Notification Listener Alert Dialog.
 * Builds the alert dialog that pops up if the user has not turned
 * the Notification Listener Service on yet.
 * @return An alert dialog which leads to the notification enabling screen
 */
private AlertDialog buildNotificationServiceAlertDialog(){
    AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
    alertDialogBuilder.setTitle("one");
    alertDialogBuilder.setMessage("two");
    alertDialogBuilder.setPositiveButton("yes",
            new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    startActivity(new Intent(ACTION_NOTIFICATION_LISTENER_SETTINGS));
                }
            });
    alertDialogBuilder.setNegativeButton("no",
            new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    // If you choose to not enable the notification listener
                    // the app. will not work as expected
                }
            });
    return(alertDialogBuilder.create());
}

@Override
protected void onDestroy() {
    super.onDestroy();
    unregisterReceiver(imageChangeBroadcastReceiver);
}

I’m not sure what I did to fix it but I got a backup of before I did any notification stuff and pasted the notification stuff into the backup of the lockscreen only.