2
votes

I make a chat application using smack in Android BEEM obviously... the problem I facing with is that when my first user is logged in and set his status/presence the status would persist for the other user when login... my user status is stored in shared preference file just like BEEM did

that's why I want to fetch my currently login user's status, so that it won't be used when other user login... so the status will always new everytime the user login...

1
sorry, but i think it just shows how to get presence by roster, which is in this case is the friends not the current user itself...user724861
@user724861 What did you reach to because i need to know that too ,if you can help ?Weloo
just add a new field on your vcard, there you can set and get your current user status message loluser724861

1 Answers

0
votes

You can't. Smack does not manage/remember the presence of the user for you. It only manages the presences that you receive (e.g. the ones from JIDs in your Rooster).

The easiest way is to create a reference to the last send Presence and updating that reference every time you send out a new Presence.