Cannot display presence mode of user in roaster....whats the problem in code..help plzz

i am using smack

{code}

Collection entries;

Roster addlist = con.getRoster();

entries = addlist.getEntries();

for (RosterEntry entry : entries)

{

System.out.println(entry.getUser() +" : "+ addlist.getPresence(entry.getUser()).getMode());

}

{code}

i am getting null for all user…even if they are online…

what is the problem in this code

and addlist.getPresence(entry.getUser()) is also showing unavailable for all user …even if they are online…

plzz help;…

The attached simple client does your task for me (just add your credentials)…
TestClient.java (1038 Bytes)

thanks a lot dude…its working…