From 5615ec7c97778de44058e76cec95eaf9d6ce2d4a Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Tue, 3 Jul 2012 12:02:58 +0000 Subject: [PATCH] Fixed code block in android tutorial --- .../android_binary_package.rst | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/doc/tutorials/introduction/android_binary_package/android_binary_package.rst b/doc/tutorials/introduction/android_binary_package/android_binary_package.rst index fa3ad1337..6e15547f2 100644 --- a/doc/tutorials/introduction/android_binary_package/android_binary_package.rst +++ b/doc/tutorials/introduction/android_binary_package/android_binary_package.rst @@ -352,40 +352,40 @@ There is a very base code snippet for Async init. It shows only basis principles public class MyActivity extends Activity implements HelperCallbackInterface { - private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) { - @Override - public void onManagerConnected(int status) { - switch (status) { - case LoaderCallbackInterface.SUCCESS: - { - Log.i(TAG, "OpenCV loaded successfully"); - // Create and set View - mView = new puzzle15View(mAppContext); - setContentView(mView); - } break; - default: - { - super.onManagerConnected(status); - } break; - } + private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) { + @Override + public void onManagerConnected(int status) { + switch (status) { + case LoaderCallbackInterface.SUCCESS: + { + Log.i(TAG, "OpenCV loaded successfully"); + // Create and set View + mView = new puzzle15View(mAppContext); + setContentView(mView); + } break; + default: + { + super.onManagerConnected(status); + } break; } - }; + } + }; - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) - { - Log.i(TAG, "onCreate"); - super.onCreate(savedInstanceState); + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) + { + Log.i(TAG, "onCreate"); + super.onCreate(savedInstanceState); - Log.i(TAG, "Trying to load OpenCV library"); - if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack)) - { - Log.e(TAG, "Cannot connect to OpenCV Manager"); - } - } + Log.i(TAG, "Trying to load OpenCV library"); + if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack)) + { + Log.e(TAG, "Cannot connect to OpenCV Manager"); + } + } - // ... + // ... } It this case application works with OpenCV Manager in asynchronous fashion. OnManagerConnected callback will be called in UI thread, when initialization finishes.