Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello OpenCV Android Sample Code - mview confusion

Hi All, I'm trying the tutorial located here

I have compiled sample code for openCV without issues - so I'm sure I have all the necessary things installed for opencv. I've added the opencv library to my project and I'm compiling with java 1.6 (java 7 doesn't work with opencv4android right now AFAIK). I added the opencv library as a resource as well.

However, the sample code doesn't make sense to me once it gets to step 5 under Hello OpenCV example.

   public void onCreate (Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     mView = new HelloOpenCVView(this);
     setContentView (mView);
}

Is the code I'm talking about, I immediately get the error "mView cannot be resolved to a variable". I can resolve it by putting HelloOpenCVView mView = new HelloOpenCVView(this) but that just causes a bunch of other problems later on. Can someone tell me what I'm doing wrong? thanks

B