public class

SessionManager

extends Object
java.lang.Object
   ↳ com.google.android.gms.cast.framework.SessionManager

Class Overview

A class that manages Session instances. The application can attach a SessionManagerListener to be notified of session events.

Summary

Public Methods
void addSessionManagerListener(SessionManagerListener<Session> listener)
Adds a SessionManagerListener to monitor events from any type of Session instance.
<T extends Session> void addSessionManagerListener(SessionManagerListener<T> listener, Class<T> sessionClass)
Adds a SessionManagerListener to monitor events from a Session instance whose class is sessionClass.
void endCurrentSession(boolean stopCasting)
Ends the current session.
CastSession getCurrentCastSession()
Returns the current session if it is an instance of CastSession, otherwise returns null.
Session getCurrentSession()
Returns the currently active session.
void removeSessionManagerListener(SessionManagerListener<Session> listener)
<T extends Session> void removeSessionManagerListener(SessionManagerListener<T> listener, Class sessionClass)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void addSessionManagerListener (SessionManagerListener<Session> listener)

Adds a SessionManagerListener to monitor events from any type of Session instance.

Throws
NullPointerException If listener is null.

public void addSessionManagerListener (SessionManagerListener<T> listener, Class<T> sessionClass)

Adds a SessionManagerListener to monitor events from a Session instance whose class is sessionClass.

Throws
NullPointerException If listener or sessionClass are null.

public void endCurrentSession (boolean stopCasting)

Ends the current session.

Parameters
stopCasting Should the receiver application be stopped when ending the current Session.

public CastSession getCurrentCastSession ()

Returns the current session if it is an instance of CastSession, otherwise returns null.

public Session getCurrentSession ()

Returns the currently active session. Returns null if no session is active.

public void removeSessionManagerListener (SessionManagerListener<Session> listener)

Parameters
listener The SessionManagerListener to be removed.

public void removeSessionManagerListener (SessionManagerListener<T> listener, Class sessionClass)

Parameters
listener The SessionManagerListener to be removed.
Throws
NullPointerException If sessionClass is null.