powered by Jive Software

RosterListener() works and not works

http://www.igniterealtime.org/builds/smack/docs/latest/documentation/roster.html

Roster roster = con.getRoster();

roster.addRosterListener(new RosterListener() {

// Ignored events public void entriesAdded(Collection addresses) {}

public void entriesDeleted(Collection addresses) {}

public void entriesUpdated(Collection addresses) {}

public void presenceChanged(Presence presence) {

System.out.println("Presence changed: " + presence.getFrom() + " " + presence);

}

});

when I run this tells me:

user1 Error

user2 Error

userx Error

then change the status of user1, it works fine, why?

why at first I get error?

Presence changed: test1@delive/Smack available

Presence changed: test1@delive/Smack available: away (Online, Programmatically!)

Presence changed: test1@delive/Smack unavailable