當前位置: 首頁>>代碼示例>>Java>>正文


Java SurfaceHolder.removeCallback方法代碼示例

本文整理匯總了Java中android.view.SurfaceHolder.removeCallback方法的典型用法代碼示例。如果您正苦於以下問題:Java SurfaceHolder.removeCallback方法的具體用法?Java SurfaceHolder.removeCallback怎麽用?Java SurfaceHolder.removeCallback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.SurfaceHolder的用法示例。


在下文中一共展示了SurfaceHolder.removeCallback方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
@Override
protected void onPause() {
  if (handler != null) {
    handler.quitSynchronously();
    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();
}
 
開發者ID:PhilippC,項目名稱:keepass2android,代碼行數:17,代碼來源:CaptureActivity.java

示例2: onPause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();
        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();
}
 
開發者ID:kkyflying,項目名稱:CodeScaner,代碼行數:19,代碼來源:CaptureActivity.java

示例3: onPause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
@Override
protected void onPause() {
	if (handler != null) {
		handler.quitSynchronously();
		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();
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:19,代碼來源:CaptureActivity.java

示例4: onPause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
public void onPause() {
    if (handler != null) {
        handler.quitSynchronously();
        handler = null;
    }
    if (inactivityTimer != null) {
        inactivityTimer.onPause();
    }
    if (ambientLightManager != null) {
        ambientLightManager.stop();
    }
    if (beepManager != null) {
        beepManager.close();
    }
    if (cameraManager != null) {
        cameraManager.closeDriver();
    }
    if (!hasSurface) {
        mSurfaceView = new SurfaceView(mActivity, null);
        SurfaceHolder surfaceHolder = mSurfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
}
 
開發者ID:10045125,項目名稱:QrCode,代碼行數:24,代碼來源:QrCodeView.java

示例5: onPause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();
    }

    // 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();
}
 
開發者ID:mercuriete,項目名稱:android-mrz-reader,代碼行數:17,代碼來源:CaptureActivity.java

示例6: onPause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();
        handler = null;
    }
    inactivityTimer.onPause();
    ambientLightManager.stop();
    beepManager.close();
    cameraManager.closeDriver();
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}
 
開發者ID:yun2win,項目名稱:tvConnect_android,代碼行數:18,代碼來源:CaptureActivity.java

示例7: onPause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
/**
 * 暫停活動監控器,關閉攝像頭
 */
@Override
protected void onPause() {
    if (mHandler != null) {
        mHandler.quitSynchronously();
        mHandler = null;
    }
    // 暫停活動監控器
    inactivityTimer.onPause();
    // 關閉攝像頭
    cameraManager.closeDriver();
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}
 
開發者ID:dufangyu1990,項目名稱:LeCatApp,代碼行數:21,代碼來源:CaptureActivity.java

示例8: pause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
/**
 * Pause scanning and the camera preview. Typically this should be called from the Activity's
 * onPause() method.
 *
 * Call from UI thread only.
 */
public void pause() {
    // This must be safe to call multiple times.
    Util.validateMainThread();
    Log.d(TAG, "pause()");

    openedOrientation = -1;
    if (cameraInstance != null) {
        cameraInstance.close();
        cameraInstance = null;
        previewActive = false;
    } else {
        stateHandler.sendEmptyMessage(R.id.zxing_camera_closed);
    }
    if (currentSurfaceSize == null && surfaceView != null) {
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(surfaceCallback);
    }
    if(currentSurfaceSize == null && textureView != null && Build.VERSION.SDK_INT >= 14) {
        textureView.setSurfaceTextureListener(null);
    }

    this.containerSize = null;
    this.previewSize = null;
    this.previewFramingRect = null;
    rotationListener.stop();

    fireState.previewStopped();
}
 
開發者ID:yinhaojun,項目名稱:ZxingForAndroid,代碼行數:35,代碼來源:CameraPreview.java

示例9: surfaceDestroyed

import android.view.SurfaceHolder; //導入方法依賴的package包/類
public void surfaceDestroyed(SurfaceHolder holder) {
    System.out.println("surfaceDestroyed");
    if (!isopen_camara)
        return;
    if (mCamera != null) {
        holder.removeCallback(this);
        mCamera.setPreviewCallback(null);
        mCamera.stopPreview();
        mCamera.lock();
        mCamera.release();
        mCamera = null;
    }
}
 
開發者ID:yzzslow0,項目名稱:Ec2m,代碼行數:14,代碼來源:CamaraActivity.java

示例10: onPause

import android.view.SurfaceHolder; //導入方法依賴的package包/類
@Override
protected void onPause() {
  if (handler != null) {
    handler.quitSynchronously();
    handler = null;
  }
  cameraManager.closeDriver();
  if (!hasSurface) {
    surfaceView = new SurfaceView(this);
    SurfaceHolder surfaceHolder = surfaceView.getHolder();
    surfaceHolder.removeCallback(this);
  }
  super.onPause();
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:15,代碼來源:AppInvCaptureActivity.java

示例11: onViewUnload

import android.view.SurfaceHolder; //導入方法依賴的package包/類
@Override
public void onViewUnload() {
    super.onViewUnload();
    inactivityTimer.shutdown();
    mViewfinderView.recycleLineDrawable();

    if (!hasSurface) {
        SurfaceHolder surfaceHolder = mSurfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:12,代碼來源:UIScanView.java

示例12: surfaceCreated

import android.view.SurfaceHolder; //導入方法依賴的package包/類
@Override
public void surfaceCreated(SurfaceHolder holder) {
    holder.removeCallback(this);
    drawSurfaceView(holder);
}
 
開發者ID:coolspan,項目名稱:LiveWallpaper,代碼行數:6,代碼來源:LiveWallpaperView.java


注:本文中的android.view.SurfaceHolder.removeCallback方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。