错误:Builder中的Builder(android.content.Context)无法应用于(com.example.pc.chromecast.MainActivity.MediaRouterCallback)

时间:2016-12-28 20:42:09

标签: android android-studio

我在这部分代码中出错:

private void launchReceiver() {
        Cast.CastOptions.Builder apiOptionsBuilder = Cast.CastOptions
                .builder( mSelectedDevice, mCastClientListener );

        ConnectionCallbacks mConnectionCallbacks = new ConnectionCallbacks();
        ConnectionFailedListener mConnectionFailedListener = new ConnectionFailedListener();
        mApiClient = new GoogleApiClient.Builder(this)
                .addApi( Cast.API, apiOptionsBuilder.build() )
                .addConnectionCallbacks( mConnectionCallbacks )
                .addOnConnectionFailedListener( mConnectionFailedListener )
                .build();

        mApiClient.connect();
    }

这是错误行:

mApiClient = new GoogleApiClient.Builder(this)

错误说:

Builder (android.content.Context) in Builder cannot be applied to (com.example.pc.chromecast.MainActivity.MediaRouterCallback)

解决问题需要做什么?

0 个答案:

没有答案