Menu

how to check online users?

Help
2013-05-20
2014-07-07
  • Heru Saputra

    Heru Saputra - 2013-05-20

    I use isLoggedIn() method, But it always return false even though the user online.
    And i use getStatus() Method, And it always return OFFLINE.
    is there any method that i can use to check online user?
    Thanks

     
  • Neil Hart

    Neil Hart - 2013-05-23

    getStatus() should work after you give the login process time to run. It is a asynchronous process. I don't see the isLoggedIn() method. What version and what class do you see that?

     
  • Heru Saputra

    Heru Saputra - 2013-05-24

    i use 0.6.0 version, and YahooUser class
    i use this code to login :
    private Session SS;
    SS = new Session();
    SS.login(Username, Password);

    and for check the user i use this code:
    YahooUser Y = new YahooUser("example");
    Y.getStatus();
    //or
    Y.isLoggedIn();

    i also try this method to print my friend list:

    Object myFriend[] = SS.getRoster().toArray();
    System.out.println(myFriend[i].toString);

    but it also give OFFLINE in status,
    is there any step that i miss?
    thanks

     
  • Heru Saputra

    Heru Saputra - 2013-05-25

    oke, forget it,
    its works now,
    thanks

     
    • Mira

      Mira - 2014-07-07

      I have the same problem. I made the login method synchronized .Still same issue.Could someone help ?
      init :
      YahooUser yu = new YahooUser("ID inmy frndslist");

      login:
      synchronized (this) {
      session.login("myid", "pwd");
      }
      System.out.println(yu.isLoggedIn());
      System.out.println(yu.getStatus());

       

Log in to post a comment.

MongoDB Logo MongoDB