0
votes

I created a sendchat text messages, but I cant get the status of other users by using roster method.

Roster roster = connection.getRoster();

                Log.e("entry count",""+roster.getEntryCount());

                Collection<RosterEntry> entries = roster.getEntries();
                Log.e("Roster Entries",""+roster.getEntries().size());
                for (RosterEntry entry : entries) {
                    Presence.Type type = entryPresence.getType();
                    if (type == Presence.Type.available)
                        Log.e("XMPPChatDemoActivity", "Presence AVIALABLE");                
                }



            } catch (XMPPException ex) {

                setConnection(null);

}

2

2 Answers

1
votes

You need to add :

If(!Roster.IsLoaded()) 
   Roster.reloadAndWait();

Before the line :

Collection<RosterEntry> entries = roster.getEntries();
0
votes

Didn't added users to roster list. After adding users to roster list only, we can get the user details.