title: How to display and interact with OKHTTP html response in android Studio using webview or Web browser
body: <p>I am building an android app. I have build a request using OKHTTP and I get the response as a string composed of html css and js content. This response is actualy a form that the user must use to allow the app to communicate with a given website. </p>
  
  <p>Now I want the user to be able to see that response as an html page and  clicks on a button to allow the communictaion. Only problem I don't know how to display  that response as an html in webview or in the web browser.</p>
  
  <p>From the MainActivity:</p>
  
  <pre><code>                          Authenticate myAouth = new Authenticate("myCostumerKey","mySecretKey");
                             try {
                                 myResponse=myAouth.run("myUrlHere");
                                 //System.out.println( myResponse);
                             } catch (Exception e) {
                                 e.printStackTrace();
                             }
  </code></pre>
  
  <p>the Autheticate class</p>
  
  <pre><code>public class Authenticate {
  private final OkHttpClient client;
  String[] myResponse =new String[2];
  public Authenticate( final String consumerKey, final String consumerSecret) {
  
      client = new OkHttpClient.Builder()
              .authenticator(new Authenticator() {
                  @Override public Request authenticate(Route route, Response response) throws IOException {
                      if (response.request().header("Authorization") != null) {
                          return null; // Give up, we've already attempted to authenticate.
                      }
  
                      System.out.println("Authenticating for response: " + response);
                      System.out.println("Challenges: " + response.challenges());
                      String credential = Credentials.basic(consumerKey, consumerSecret);
                      Request myRequest =response.request().newBuilder()
                              .header("Authorization", credential)
                              .build();
                      HttpUrl myURL = myRequest.url();
                      myResponse[0]= String.valueOf(myURL);
                      return myRequest;
                  }
              })
              .build();
  }
  
  @RequiresApi(api = Build.VERSION_CODES.KITKAT)
  public String[] run(String url) throws Exception {
      Request request = new Request.Builder()
              .url(url)
              .build();
  
  
      try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
          myResponse[1]=response.body().string();
          System.out.println(" URL is "+myResponse[0]+" my response body is "+myResponse[1]);
  
      }
  
      return myResponse;
  }}
  </code></pre>
  
  <p>Any help would be apriciated.</p>
  
  <p>Kind Regards</p>