Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

How to determine if OpenCV4Android has already been initialized?

$
0
0
We initialize OpenCV4Android using OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, activityContext, baseLoaderCallback); The situation I am facing is that in my launcher Activity, I have two buttons, and clicking on them results in a start of a different Activity. Let's call those activities A and B. My JavaCameraView is in one of those two activities, say A. So I am executing the above statement in A. But what if the user never enters the Activity A, what if they directly enter the Activity B? I need the OpenCV4Android to be initialized in Activity B as well. So I need to do something like: if (OpenCV4Android IS NOT INITIALIZED) { OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, activityContext, baseLoaderCallback); } How do I perform that check in `if`?

Viewing all articles
Browse latest Browse all 19555

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>