hey all, i want to get time, and send Time packet like this
Time timeRequest = new Time();
timeRequest.setType(IQ.Type.GET);
timeRequest.setTo("123456@domain/android);
// Create a packet collector to listen for a response.
PacketCollector collector = con.createPacketCollector(
new PacketIDFilter(timeRequest.getPacketID()));
con.sendPacket(timeRequest);
// Wait up to 5 seconds for a result.
IQ result = (IQ)collector.nextResult(5000);
if (result != null && result.getType() == IQ.Type.RESULT) {
Time timeResult = (Time)result;
// can’t get the time %>_<%
}
receive the packet like this
how can i get the time ? thanks!