@Override
  public boolean init(final Context context, final AttributeSet attrs) {
    if (!super.init(context, attrs)) {
      return false;
    }

    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AwesomePreference);

    int filePath = -1, filePathList = -1, fileValue = -1;
    if (a != null) {
      filePath = a.getResourceId(R.styleable.AwesomePreference_filePath, -1);
      filePathList = a.getResourceId(R.styleable.AwesomePreference_filePathList, -1);
      fileValue = a.getResourceId(R.styleable.AwesomePreference_fileValue, -1);
      mStartup = a.getBoolean(R.styleable.AwesomePreference_startup, mStartup);
      mMultiFile = a.getBoolean(R.styleable.AwesomePreference_multifile, mMultiFile);
      mValueChecked = a.getString(R.styleable.AwesomePreference_valueChecked);
      mValueNotChecked = a.getString(R.styleable.AwesomePreference_valueNotChecked);
      a.recycle();
    }

    final Resources res = context.getResources();
    if (filePath != -1) {
      mPath = Utils.checkPath(res.getString(filePath));
      mPaths = null;
    } else if (filePathList != -1) {
      mPaths = res.getStringArray(filePathList);
      mPath = Utils.checkPaths(mPaths);
      if (mPath.isEmpty() || !mMultiFile) {
        mPaths = null;
      }
    } else {
      mPath = "";
      mPaths = null;
    }

    if (!TextUtils.isEmpty(mPath) && filePathList != -1 && fileValue != -1) {
      final int index = Arrays.asList(res.getStringArray(filePathList)).indexOf(mPath);
      final String[] values = res.getStringArray(fileValue)[index].split(";");
      mValueChecked = values[0];
      mValueNotChecked = values[1];
      Logger.d(
          this, "mValueChecked -> %s\nmValueNotChecked -> %s", mValueChecked, mValueNotChecked);
    }

    if (TextUtils.isEmpty(mValueChecked)) {
      mValueChecked = "1";
    }
    if (TextUtils.isEmpty(mValueNotChecked)) {
      mValueNotChecked = "0";
    }

    handleSelf(true);

    return true;
  }