How to update the screen in Android?
<p>I have to show the received data of a UDP server. When data is coming from the server at that time I have to show that on the screen one by one. How to update the screen (Textview (or) EditText)?</p>

<p>I need to add (rec_str) value to the screen.</p>

<pre><code>public void run() {
    try {
        DatagramSocket clientsocket = new DatagramSocket(9876);
        byte[] receivedata = new byte[1024];
        while(true)
        {
            DatagramPacket recv_packet = new DatagramPacket(receivedata, receivedata.length);
            Log.d("UDP", "S: Receiving...");
            clientsocket.receive(recv_packet);
            String rec_str = new String(recv_packet.getData());
            Log.d(" Received String ",rec_str);
            InetAddress ipaddress = recv_packet.getAddress();
            int port=recv_packet.getPort();
            Log.d("IPAddress : ",ipaddress.toString());
            Log.d(" Port : "    ,Integer.toString(port));
        }
    } catch (Exception e) {
        Log.e("UDP", "S: Error", e);
    }
}
</code></pre>

<p>When I use <code>settext</code> it displays the last text only. How can I see all the incomming data?
(Data will come one by one. When the data is comming I need to display the current data with the existing data also.)</p>
