Updating UI when XMPP message arrived
<p>I'm new to Android. In my current project I'm using the asmack library to receive XMPP messages. In my MainActivity I have:</p>

<pre><code>Connection connection; // from the asmack library
</code></pre>

<p>and</p>

<pre><code>connection.addPacketListener(new PacketListener() {
    public void processPacket(Packet packet) {
        // HERE! is where I want to update the UI when I receive packets
    }
}
</code></pre>

<p>The weird thing is when I parse the packet and simply call setText() on two labels. At first nothing happens, but when I touch a Button (hence calling some update routine) only the first label is updated.</p>

<p>Now, as far as I understood you're supposed to use AsyncTask in such cases but this didn't work out either.</p>

<p>Did I misunderstood some core concept? Can someone lead me to the right path?</p>
