title: Android Programming: HTTP GET REQUEST NOT WORKING
body: <p>I require a GET reequest from my own server to be extracted from the web and then displayed on screen with a TextView.</p>
  
  <p>I have set up a GET Request.</p>
  
  <pre><code>public class GetMethodEx {
  
  
  public String getInternetData() throws Exception{
          BufferedReader in = null;
          String data = null;
          try
          {
              HttpClient client = new DefaultHttpClient();
              URI website = new URI("http://www.mybringback.com");
              HttpGet request = new HttpGet();
              request.setURI(website);
              HttpResponse response = client.execute(request);
              in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
              StringBuffer sb = new StringBuffer("");
              String l = "";
              String nl = System.getProperty("line.separator");
              while ((l = in.readLine()) !=null){
                  sb.append(l + nl);
              }
              in.close();
              data = sb.toString();
              return data;        
          } finally{
              if (in != null){
                  try{
                      in.close();
                      return data;
                  }catch (Exception e){
                      e.printStackTrace();
                  }
              }
          }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And I have set up on my main thread to extract the information and display it in a text view.</p>
  
  <pre><code>public class Home extends Activity {
  
      TextView httpStuff;
  
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.httpexample);
          httpStuff = (TextView) findViewById(R.id.tvhttp);
          GetMethodEx test = new GetMethodEx();
          String returned;
          try {
              returned = test.getInternetData();
              httpStuff.setText(returned);
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>However, the Textview doesnt seem to change?</p>
  
  <p>Can someone help me please.</p>