title: Logcat showing "Shutting down VM"
body: <p>I'm trying to connect to a server and print the responses.<br>
  Weird thing is that when I click on the button in my activity that starts the connection,<br>
  it force closes immediately.<br>
  After looking in <code>logcat</code>, what I see is that VM is shutting down.<br>
  I do see that there appears to be someone that saw a similar problem as me:<br>
  <a href="https://stackoverflow.com/questions/13579284/the-logcat-in-android-shows-simply-shutting-down-the-vm">The logcat in android shows simply shutting down the VM?</a><br>
  Unfortunately, I don't think the problem was actually answered, and it really puzzles me.</p>
  
  <p>Stack trace:  </p>
  
  <pre><code>03-06 20:12:47.012: I/System.out(2757): I'm in main
  03-06 20:12:48.092: D/gralloc_goldfish(2757): Emulator without GPU emulation detected.
  03-06 20:13:03.462: I/System.out(2757): I'm at quote viewer
  03-06 20:13:04.291: I/Choreographer(2757): Skipped 32 frames!  The application may be doing too much work on its main thread.
  03-06 20:13:09.881: D/AndroidRuntime(2757): Shutting down VM
  03-06 20:13:09.881: W/dalvikvm(2757): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
  03-06 20:13:09.901: D/dalvikvm(2757): GC_CONCURRENT freed 130K, 9% free 2652K/2888K, paused 80ms+5ms, total 222ms
  03-06 20:13:09.941: E/AndroidRuntime(2757): FATAL EXCEPTION: main
  03-06 20:13:09.941: E/AndroidRuntime(2757): java.lang.IllegalStateException: Could not execute method of the activity
  </code></pre>
  
  <p>Line 3 ("I'm at quote viewer") is the part where I'm in the QuoteViewerActivity where I have a button that connects to the server when pressed.<br>
  Code for the QuoteViewerActivity below:  </p>
  
  <pre><code>package com.pheno.networkprogrammingiphenoexercise;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.TextView;
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.net.Socket;
  import java.net.UnknownHostException;
  
  public class QuoteViewerActivity extends Activity {
      private String mHost = "ota.iambic.com";
      private int mPort = 17;
      private TextView mQuote1, mQuote2, mQuote3;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          System.out.println("I'm at quote viewer");
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_quote_viewer);
          mQuote1 = (TextView)findViewById(R.id.quote1);
          mQuote2 = (TextView)findViewById(R.id.quote2);
          mQuote3 = (TextView)findViewById(R.id.quote3);
      }
  
      public void showQuotes(View clickedButton) {
  
          try {
              TextView[] quoteArray = {mQuote1, mQuote2, mQuote3};
              for(int i = 0; i &lt; 3; i++) {
                  Socket socket = new Socket(mHost, mPort);
                  System.out.println("Get Socket");
                  BufferedReader in = SocketUtils.getReader(socket);
                  String quoteResult = in.readLine();
                  System.out.println(quoteResult);
                  quoteArray[i].setText(quoteResult);
                  socket.close();
              }
          } catch(UnknownHostException uhe) {
              mQuote1.setText("Unknown host: " + mHost);
              //uhe.printStackTrace();
              Log.e("pheno", "What happened", uhe);
          } catch(IOException ioe) {
              mQuote1.setText("IOException: " + ioe);
              Log.e("pheno", "What happened", ioe);
          }
      }
  }
  </code></pre>
  
  <p>Any help or suggestion would be much appreciated! Thanks!</p>