title: how to print a string in a textview?
body: <p>I am new to all of this android programming. After working out a few codes, I get the following string called ipString. I would like to display the string in a textview.</p>
  
  <p>Here is what I have for now.</p>
  
  <p>What should I add to make it work?</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Log.d("Rami","Rami");
      DefaultHttpClient   httpclient = new DefaultHttpClient(new BasicHttpParams());
      HttpPost httppost = new HttpPost("http://jsonip.com");
      // Depends on your web service
      httppost.setHeader("Content-type", "application/json");
  
      InputStream inputStream = null;
      String result = null;
      try {
          HttpResponse response = httpclient.execute(httppost);           
          HttpEntity entity = response.getEntity();
  
          inputStream = entity.getContent();
          // json is UTF-8 by default
          BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8);
          StringBuilder sb = new StringBuilder();
  
          String line = null;
          while ((line = reader.readLine()) != null)
          {
              sb.append(line + "\n");
  
          }
          result = sb.toString();
          JSONObject jObject = new JSONObject(result);
          String ipString = jObject.getString("ip");
          Log.d("ip", ipString);
      } catch (Exception e) { 
          // Oops
      }
      finally {
          try{if(inputStream != null)inputStream.close();}catch(Exception squish){}
      }
  
      TextView myTextView = (TextView) findViewById(R.id.textview1);
  </code></pre>