Search in sources :

Example 6 with MediaRouteActionProvider

use of android.support.v7.app.MediaRouteActionProvider in project cw-omnibus by commonsguy.

the class PlaybackFragment method onCreateOptionsMenu.

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    this.menu = menu;
    inflater.inflate(R.menu.main, menu);
    updateMenu();
    MenuItem item = menu.findItem(R.id.route_provider);
    MediaRouteActionProvider provider = (MediaRouteActionProvider) MenuItemCompat.getActionProvider(item);
    provider.setRouteSelector(selector);
}
Also used : MediaRouteActionProvider(android.support.v7.app.MediaRouteActionProvider) MenuItem(android.view.MenuItem)

Example 7 with MediaRouteActionProvider

use of android.support.v7.app.MediaRouteActionProvider in project MediaRouter-Cast-Button-android by googlecast.

the class MediaRouterActionBarButtonActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    getMenuInflater().inflate(R.menu.main, menu);
    MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item);
    MediaRouteActionProvider mediaRouteActionProvider = (MediaRouteActionProvider) MenuItemCompat.getActionProvider(mediaRouteMenuItem);
    // Set the MediaRouteActionProvider selector for device discovery.
    mediaRouteActionProvider.setRouteSelector(mMediaRouteSelector);
    return true;
}
Also used : MediaRouteActionProvider(android.support.v7.app.MediaRouteActionProvider) MenuItem(android.view.MenuItem)

Example 8 with MediaRouteActionProvider

use of android.support.v7.app.MediaRouteActionProvider in project MediaRouter-Cast-Button-android by googlecast.

the class MediaRouterCustomDialogActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    getMenuInflater().inflate(R.menu.main, menu);
    MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item);
    MediaRouteActionProvider mediaRouteActionProvider = (MediaRouteActionProvider) MenuItemCompat.getActionProvider(mediaRouteMenuItem);
    // Set the MediaRouteActionProvider selector for device discovery.
    mediaRouteActionProvider.setRouteSelector(mMediaRouteSelector);
    // Set the custom dialog factory for a custom control dialog
    mediaRouteActionProvider.setDialogFactory(mCustomMediaRouteDialogFactory);
    return true;
}
Also used : MediaRouteActionProvider(android.support.v7.app.MediaRouteActionProvider) MenuItem(android.view.MenuItem)

Example 9 with MediaRouteActionProvider

use of android.support.v7.app.MediaRouteActionProvider in project CastHelloText-android-v2 by googlecast.

the class MainActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    getMenuInflater().inflate(R.menu.main, menu);
    MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item);
    MediaRouteActionProvider mediaRouteActionProvider = (MediaRouteActionProvider) MenuItemCompat.getActionProvider(mediaRouteMenuItem);
    // Set the MediaRouteActionProvider selector for device discovery.
    mediaRouteActionProvider.setRouteSelector(mMediaRouteSelector);
    return true;
}
Also used : MediaRouteActionProvider(android.support.v7.app.MediaRouteActionProvider) MenuItem(android.view.MenuItem)

Aggregations

MediaRouteActionProvider (android.support.v7.app.MediaRouteActionProvider)9 MenuItem (android.view.MenuItem)9