@Override public void onOperatingSystemChanged() { if (mSpinnerPartitionScheme == null || !mOperatingSystem.isCreationMode()) return; OperatingSystemEditActivity.MultibootDir location = mOperatingSystem.getLocation(); String osType = mOperatingSystem.getOperatingSystemType(); // check if sth. has changed if (mPreviousOSType != null && mPreviousLocation != null) { if (mPreviousOSType.equals(osType) && mPreviousLocation == location) return; } // spinner schemes mSpinnerSchemes.clear(); if (location != null) { boolean bindSupported = OperatingSystem.isBindAllowed(mOperatingSystem.getLocation().mountEntry.getFsType()); if (bindSupported) mSpinnerSchemes.add(SCHEMES.get(SCHEMEID_ANDROID_DYNSYS_BINDOTHER)); if (bindSupported) mSpinnerSchemes.add(SCHEMES.get(SCHEMEID_ANDROID_BINDALL)); mSpinnerSchemes.add(SCHEMES.get(SCHEMEID_ANDROID_DYNSYS_LOOPOTHER)); mSpinnerSchemes.add(SCHEMES.get(SCHEMEID_ANDROID_LOOPALL)); } mSpinnerPartitionScheme.setAdapter( new ArrayAdapter<>( getContext(), R.layout.support_simple_spinner_dropdown_item, mSpinnerSchemes)); // update previous data mPreviousOSType = osType; mPreviousLocation = location; }