Example usage for android.view SurfaceHolder removeCallback

List of usage examples for android.view SurfaceHolder removeCallback

Introduction

In this page you can find the example usage for android.view SurfaceHolder removeCallback.

Prototype

public void removeCallback(Callback callback);

Source Link

Document

Removes a previously added Callback interface from this holder.

Usage

From source file:org.madmatrix.zxing.android.CaptureActivity.java

@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();//from w w w. ja  va 2  s. co m
        handler = null;
    }

    // ?
    inactivityTimer.onPause();

    // ??
    cameraManager.closeDriver();
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}

From source file:com.google.zxing.client.android.CaptureActivity.java

@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();//from w ww  .ja  va  2 s .c  om
        handler = null;
    }
    inactivityTimer.onPause();
    ambientLightManager.stop();
    cameraManager.closeDriver();
    // historyManager = null; // Keep for onActivityResult
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(EUExUtil.getResIdID("preview_view"));
        if (surfaceView != null) {
            SurfaceHolder surfaceHolder = surfaceView.getHolder();
            surfaceHolder.removeCallback(this);
        }
    }
    super.onPause();
}

From source file:zxing.util.CaptureActivity.java

License:asdf

@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();//www .  j  a  va 2s. c  o m
        handler = null;
    }
    inactivityTimer.onPause();
    ambientLightManager.stop();
    cameraManager.closeDriver();
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}

From source file:com.android.onemedia.playback.LocalRenderer.java

private void cleanUpPlayer() {
    if (DEBUG) {/*from   ww w . j  av  a 2 s  . co  m*/
        Log.d(TAG, mDebugId + ": Cleaning up current player");
    }
    synchronized (mErrorLock) {
        mError = null;
        if (mErrorRetriever != null) {
            mErrorRetriever.cancelRequestLocked(false);
            // Don't set to null as we may need to cancel again with true if
            // the object gets destroyed.
        }
    }
    mAudioManager.abandonAudioFocus(this);

    SurfaceHolder.Callback cb = mHolderCB;
    mHolderCB = null;
    SurfaceHolder holder = mHolder;
    mHolder = null;
    if (holder != null && cb != null) {
        holder.removeCallback(cb);
    }

    MediaPlayer player = mPlayer;
    mPlayer = null;
    if (player != null) {
        player.reset();
        player.release();
    }
}

From source file:com.cleverzone.zhizhi.capture.CaptureActivity.java

@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();/*from   w w  w  . jav a  2s. c o m*/
        handler = null;
    }
    inactivityTimer.onPause();
    //        ambientLightManager.stop();
    beepManager.close();
    cameraManager.closeDriver();
    //historyManager = null; // Keep for onActivityResult
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}

From source file:net.oschina.app.v2.activity.zxing.CaptureActivity.java

@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();// w ww. j a v  a  2 s. c om
        handler = null;
    }
    inactivityTimer.onPause();
    ambientLightManager.stop();
    beepManager.close();
    cameraManager.closeDriver();
    //historyManager = null; // Keep for onActivityResult
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}

From source file:com.xgf.inspection.qrcode.google.zxing.client.CaptureActivity.java

@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();//w w  w .  ja va 2 s . c o  m
        handler = null;
    }
    inactivityTimer.onPause();
    cameraManager.closeDriver();
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}

From source file:com.edible.ocr.CaptureActivity.java

@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();/*from ww  w.  j av  a  2  s .  c  o  m*/
    }

    // Stop using the camera, to avoid conflicting with other camera-based apps
    cameraManager.closeDriver();

    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}