public class SessionTracker extends Object
Constructor and Description |
---|
SessionTracker(Context context,
Session.StatusCallback callback)
Constructs a SessionTracker to track the active Session object.
|
SessionTracker(Context context,
Session.StatusCallback callback,
Session session,
boolean startTracking)
Constructs a SessionTracker to track the Session object passed in.
|
Modifier and Type | Method and Description |
---|---|
Session |
getOpenSession()
Returns the current Session that's being tracked if it's open,
otherwise returns null.
|
Session |
getSession()
Returns the current Session that's being tracked.
|
boolean |
isTracking()
Returns whether it's currently tracking the Session.
|
boolean |
isTrackingActiveSession()
Returns whether it's currently tracking the active Session.
|
void |
setSession(Session newSession)
Set the Session object to track.
|
void |
startTracking()
Start tracking the Session (either active or the one given).
|
void |
stopTracking()
Stop tracking the Session and remove any callbacks attached
to those sessions.
|
public SessionTracker(Context context, Session.StatusCallback callback)
context
- the context object.callback
- the callback to use whenever the active Session's
state changespublic SessionTracker(Context context, Session.StatusCallback callback, Session session, boolean startTracking)
context
- the context object.callback
- the callback to use whenever the Session's state changessession
- the Session object to trackstartTracking
- whether to start tracking the Session right awaypublic Session getSession()
public Session getOpenSession()
public void setSession(Session newSession)
newSession
- the new Session object to trackpublic void startTracking()
public void stopTracking()
public boolean isTracking()
public boolean isTrackingActiveSession()