Posting message use toast and setText() inside thread
<p>i want to post some message with setText() method inside thread when readline!= null, but i found error. I can't show toast and use setText() method.</p>

<pre><code>public void run(){

    Looper.myLooper();
    Looper.prepare();

    try {           
        while(!((line = in.readLine()).equalsIgnoreCase("quit"))){              
            if(line.isEmpty()){
                System.out.println("there is no message");
            }else{                      

     Toast.makeText(this, "Message= " + line , Toast.LENGTH_SHORT).show();
                msgbox.setText(line);
            }               
        }           
    } catch (IOException e) {
        e.printStackTrace();
        System.out.println("Gagal mengirim ACK ke server");
    }

}
</code></pre>
