Methods Summary |
---|
private void | ensureRouteSelector()
if (mSelector == null) {
Bundle args = getArguments();
if (args != null) {
mSelector = MediaRouteSelector.fromBundle(args.getBundle(ARGUMENT_SELECTOR));
}
if (mSelector == null) {
mSelector = MediaRouteSelector.EMPTY;
}
}
|
public android.support.v7.media.MediaRouteSelector | getRouteSelector()Gets the media route selector for filtering the routes that the user can select.
ensureRouteSelector();
return mSelector;
|
public MediaRouteChooserDialog | onCreateChooserDialog(android.content.Context context, android.os.Bundle savedInstanceState)Called when the chooser dialog is being created.
Subclasses may override this method to customize the dialog.
return new MediaRouteChooserDialog(context);
|
public android.app.Dialog | onCreateDialog(android.os.Bundle savedInstanceState)
MediaRouteChooserDialog dialog = onCreateChooserDialog(getActivity(), savedInstanceState);
dialog.setRouteSelector(getRouteSelector());
return dialog;
|
public void | setRouteSelector(android.support.v7.media.MediaRouteSelector selector)Sets the media route selector for filtering the routes that the user can select.
This method must be called before the fragment is added.
if (selector == null) {
throw new IllegalArgumentException("selector must not be null");
}
ensureRouteSelector();
if (!mSelector.equals(selector)) {
mSelector = selector;
Bundle args = getArguments();
if (args == null) {
args = new Bundle();
}
args.putBundle(ARGUMENT_SELECTOR, selector.asBundle());
setArguments(args);
MediaRouteChooserDialog dialog = (MediaRouteChooserDialog)getDialog();
if (dialog != null) {
dialog.setRouteSelector(selector);
}
}
|