title: doesn't display toast message android
body: <p>I want to display a message when data from client is received. I started a server and a client. Client sends and receives confirmation from server, but on server side android, wasn't displayed any message, and app crashed, and here I paste what i got from log cat.
  and also inner class, when i want to show message:</p>
  
  <pre><code>import android.widget.Toast;
  
  class Handler implements Runnable { 
      private Context myContext; 
  
      private static final String TAG = "myLogs";
  
      public Handler(Socket client) { 
          this.client = client; 
      } 
      public Handler(final Context context) { 
          this.myContext= context; 
      } 
  
      public void run() { 
          try {
              //message received..
  
              Toast.makeText(myContext.getApplicationContext(), "msg msg", Toast.LENGTH_SHORT).show();
              Log.d(TAG, "received....");
          } catch (IOException e) { 
              System.out.println("Errore: " + e); 
          } 
      } 
  } 
  </code></pre>
  
  <p><strong>Logcat</strong></p>
  
  <pre><code>   04-29 17:21:53.679: D/My log(19533): waiting for connnections   
     04-29 17:24:13.726: D/My Log(19533): Connected     04-29
     17:24:14.859:W/dalvikvm(19533): threadid=9: thread exiting with uncaught exception    (group=0x40018578)     04-29 17:24:14.859: E/AndroidRuntime(19533): FATAL EXCEPTION: Thread-10 04-29
     17:24:14.859: E/AndroidRuntime(19533): java.lang.NullPointerException     04-29
     17:24:14.859:E/AndroidRuntime(19533): at com.example.tcpserver.Handler.run(Handler.java:49)     04-29
     17:24:14.859: E/AndroidRuntime(19533): at java.lang.Thread.run(Thread.java:1019)
  </code></pre>