public void setGuide() {
    mTitle.setText(Html.fromHtml(mGuide.getTitle()));
    mIntro.setText(Utils.correctLinkPaths(Html.fromHtml(mGuide.getIntroductionRendered())));

    if (!mGuide.getDifficulty().equals("false")) {
      mDifficulty.setText(
          getActivity().getString(R.string.difficulty)
              + ": "
              + Utils.correctLinkPaths(Html.fromHtml(mGuide.getDifficulty())));
    }

    mAuthor.setText(
        getActivity().getString(R.string.author)
            + ": "
            + Utils.correctLinkPaths(Html.fromHtml(mGuide.getAuthor())));
  }
Exemplo n.º 2
0
  @Override
  public void onCreate() {
    // OkHttp changes the global SSL context, breaks other HTTP clients.  Google Analytics uses a
    // different http
    // client, which OkHttp doesn't handle well.
    // https://github.com/square/okhttp/issues/184
    if (!mUrlStreamFactorySet) {
      URL.setURLStreamHandlerFactory(Utils.createOkHttpClient());
      mUrlStreamFactorySet = true;
    }

    // Use OkHttp instead of HttpUrlConnection to handle HTTP requests, OkHttp supports 2.2 while
    // HttpURLConnection
    // is a bit buggy on froyo.
    if (!mConnectionFactorySet) {
      HttpRequest.setConnectionFactory(new OkConnectionFactory());
      mConnectionFactorySet = true;
    }

    super.onCreate();

    sMainApplication = this;
    setSite(getDefaultSite());
  }