80,351
社区成员
发帖
与我相关
我的任务
分享
private CameraSurfaceView mCameraSurfaceView;
private Button mShutterButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OCRHelper.initial(this);
mCameraSurfaceView = (CameraSurfaceView) View.inflate(this,
R.layout.main, null);
mCameraSurfaceView.setCameraFlash(false);
mCameraSurfaceView.setFocusViewColor(Color.GREEN);
mCameraSurfaceView.setPictureCallback(this);
mShutterButton.setOnClickListener(this);
setContentView(mCameraSurfaceView);
initialTessdata(this);
}
<team.A1.ocrdemo.CameraSurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/bnShutter"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="50dp"
android:background="@drawable/bgr_shutter" />
</team.A1.ocrdemo.CameraSurfaceView>
final Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);