Moving contact in roster?

hi all,

I’'d like to know how to move a contact existing at the root of the roster (I mean in no roster group) to a roster group of my choice, without being obliged to delete the contact (calling removeEntry method) to be able to add it in the roster group of my choice…

I’‘m cope with this problem when a contact add me to his roster when I’'m offline: the contact puts itself at the root of my roster…and i dont want it! iwant to put it in a group…

thx for your help cause I really need it…

e07

RosterGroup#addEntry(RosterEntry entry) will add an entry into the group of your choice

thx for reply but,

if you have a contact at the root of the roster (I mean which not belongs to any roster group), and use addEntry method, the contact will exist twice in the roster: one at the root of the roster and one added in a group with the addEntry() method!

And if I use deleteEntry method it will have a negative impact on the roster of the contact (unsubscribe presence packets…etc)

Then, what can do???

thx for your help…

e07

This is from the Javadocs so I presume it to work

RosterGroup#addEntry()

Adds a roster entry to this group. If the entry was unfiled then it will be removed from the unfiled list and will be added to this group.

So if you’'ve added a contact to your Roster but not added them to a group they will be in the unfiled list. When you then call RosterGroup#addEntry() they will be removed from the unfiled group and placed into the specified group.

Hi Jon,

thx for reply,

In my few tries, when i did as you told, the contact is 2 times in the roster:

one at the root of the roster (I mean in no group), and one in the group I’'ve targeted whit the RosterGroup#addEntry()…

Can you make a try, and send me a code snippet if that’‘s ok for you? I’'ve certainly missed somthing…

thx for all, it will be very helpful!

e07