/** Creates the theme, static colours fragment. */
 private void initialiseStaticColoursFragment() {
   FragmentManager fm = getFragmentManager();
   FragmentTransaction ft = fm.beginTransaction();
   int coloursPerSequence = Theme.MAX_COLOURS_PER_THEME;
   if (persistenceManager.getDidio() != null && persistenceManager.getDidio().isLegacy()) {
     coloursPerSequence = Theme.MAX_COLOURS_PER_THEME_LEGACY;
   }
   staticColours = StaticColoursFragment.newInstance(true, coloursPerSequence, theme);
   ft.add(R.id.flThemeStaticColours, staticColours).commit();
 }
 @Override
 public void onStop() {
   if (optionsFragment != null && !optionsFragment.isThemeRemoved()) {
     // update the sequence
     theme.setColours(staticColours.getColours());
     theme.setName(optionsFragment.getName());
     for (int i = 0; i < themes.size(); i++) {
       if (themes.get(i).getObjId().equals(theme.getObjId())) {
         themes.set(i, theme);
       }
     }
     persistenceManager.setThemes(themes);
   }
   super.onStop();
 }