UserManager.java :  » Web » phonemapper » com » androidcourse » phonemapper » model » Android Open Source

Android Open Source » Web » phonemapper 
phonemapper » com » androidcourse » phonemapper » model » UserManager.java
package com.androidcourse.phonemapper.model;

/**
 * 
 * @author gpachov Semanthics: UserManager is a singleton class, holding the
 *         current user. If the currentUser is null, then there is no user
 *         logged.
 */
public class UserManager {

  private static UserManager sUserManager;

  public static UserManager getInstance() {
    if (sUserManager == null) {
      sUserManager = new UserManager();
    }
    return sUserManager;
  }

  private User mCurrentUser;

  public User getCurrentUser() {
    return mCurrentUser;
  }

  
  
  /**
   * pre: Called with non-null argument ONLY in LoginActivity Called with null
   * argument from elsewhere
   * 
   * @param user
   */
  public void setActiveUser(User user) {
    mCurrentUser = user;
  }

  public void logoutUser() {
    
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.