code: private void obtainUnit(@NonNull final TypedArray typedArray) {
          CharSequence obtainedUnit = typedArray.getText(R.styleable.AbstractUnitPreference_unit);
  
          if (obtainedUnit == null) {
              obtainedUnit = getContext().getText(R.string.resolution_preference_unit);
          }
  
          setUnit(obtainedUnit);
      }
docs: Obtains the unit of the resolution, which is shown in the preference's dialog, from a
  specific typed array.
  
  @param typedArray
  The typed array, the unit should be obtained from, as an instance of the class {@link
  TypedArray}. The typed array may not be null