public void run() {
if( dialog.cancelled ) return;
XMPPConnection con = BuddyList.getInstance().getConnection();
LastActivity request = new LastActivity();
request.setType(IQ.Type.GET);
request.setTo(dialog.getUser());
// Create a packet collector to listen for a response.
PacketCollector collector = con
.createPacketCollector(new PacketIDFilter(request.getPacketID()));
con.sendPacket(request);
// Wait up to 5 seconds for a result.
IQ result = (IQ) collector.nextResult(SmackConfiguration
.getPacketReplyTimeout());
if( dialog.cancelled ) return;
if (result != null && result.getType() == IQ.Type.RESULT) {
LastActivity t = (LastActivity) result;
field.setText(t.showTime());
} else
field.setText("N/A");
field.validate();
}