Beispiel #1
0
    public String getString(Context c) {
      try {
        if (mMessage != null) {
          return mMessage;
        } else {
          if (c != null) {
            if (mRessourceId == com.openvpn.Durai.R.string.mobile_info)
              return getMobileInfoString(c);
            if (mArgs == null) return c.getString(mRessourceId);
            else return c.getString(mRessourceId, mArgs);
          } else {
            String str = String.format(Locale.ENGLISH, "Log (no context) resid %d", mRessourceId);
            if (mArgs != null) str += TextUtils.join("|", mArgs);

            return str;
          }
        }
      } catch (UnknownFormatConversionException e) {
        if (c != null)
          throw new UnknownFormatConversionException(e.getLocalizedMessage() + getString(null));
        else throw e;
      } catch (java.util.FormatFlagsConversionMismatchException e) {
        if (c != null)
          throw new FormatFlagsConversionMismatchException(
              e.getLocalizedMessage() + getString(null), e.getConversion());
        else throw e;
      }
    }