Added second sample for Android Java API
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.opencv.samples"
|
||||
package="org.opencv.samples.s0"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package org.opencv.samples;
|
||||
package org.opencv.samples.s0;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
@@ -1,4 +1,4 @@
|
||||
package org.opencv.samples;
|
||||
package org.opencv.samples.s0;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -69,10 +69,12 @@ class Sample0View extends SurfaceView implements SurfaceHolder.Callback, Runnabl
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
mThreadRun = false;
|
||||
if(mCamera != null) {
|
||||
mCamera.stopPreview();
|
||||
mCamera.setPreviewCallback(null);
|
||||
mCamera.release();
|
||||
mCamera = null;
|
||||
synchronized(Sample0View.this) {
|
||||
mCamera.stopPreview();
|
||||
mCamera.setPreviewCallback(null);
|
||||
mCamera.release();
|
||||
mCamera = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user