android/src/info/walltime/bitcast/Bitcast.java
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mMediaRouter = MediaRouter.getInstance(getApplicationContext());

        mMediaRouteSelector = new MediaRouteSelector.Builder()
                .addControlCategory(CastMediaControlIntent.categoryForCast(APP_ID))
                .build();

        final android.support.v7.app.MediaRouteButton button
                = (MediaRouteButton) findViewById(R.id.main_button);

        mMediaRouterCallback = new RouterCallback();
        mConnectionFailedListener = new ConnectionFailedListener();
        mConnectionCallbacks = new ConnectionCallbacks();
        mCastClientListener = new CastListener();

        button.setRouteSelector(mMediaRouteSelector);
        Button otherButton = (Button) findViewById(R.id.start);

        otherButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                button.showDialog();
            }
        });
    }
/**
     * Called when the activity is first created.
     */
Called when the activity is first created.
Called when the activity is first created .
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mMediaRouter = MediaRouter.getInstance(getApplicationContext());
        mMediaRouteSelector = new MediaRouteSelector.Builder()
                .addControlCategory(CastMediaControlIntent.categoryForCast(APP_ID))
                .build();
        final android.support.v7.app.MediaRouteButton button
                = (MediaRouteButton) findViewById(R.id.main_button);
        mMediaRouterCallback = new RouterCallback();
        mConnectionFailedListener = new ConnectionFailedListener();
        mConnectionCallbacks = new ConnectionCallbacks();
        mCastClientListener = new CastListener();
        button.setRouteSelector(mMediaRouteSelector);
        Button otherButton = (Button) findViewById(R.id.start);
        otherButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                button.showDialog();
            }
        });
    }
@ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . main ) ; mMediaRouter = MediaRouter . getInstance ( getApplicationContext ( ) ) ; mMediaRouteSelector = new MediaRouteSelector . Builder ( ) . addControlCategory ( CastMediaControlIntent . categoryForCast ( APP_ID ) ) . build ( ) ; final android . support . v7 . app . MediaRouteButton button = ( MediaRouteButton ) findViewById ( R . id . main_button ) ; mMediaRouterCallback = new RouterCallback ( ) ; mConnectionFailedListener = new ConnectionFailedListener ( ) ; mConnectionCallbacks = new ConnectionCallbacks ( ) ; mCastClientListener = new CastListener ( ) ; button . setRouteSelector ( mMediaRouteSelector ) ; Button otherButton = ( Button ) findViewById ( R . id . start ) ; otherButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { button . showDialog ( ) ; } } ) ; }
Called when the activity is first created.
Called when the activity is first created .