title: OpenCv crashes when calling from android activity
body: <p>i have this code in which i use openCV to launch a camera. The code is given below. If this class "MainActivity" is used as the main class then every thing works fine but if i use it from another activity then the application crashes.</p>
  
  <p>Here's the code of openCV android</p>
  
  <pre><code>public class MainActivity extends Activity implements CvCameraViewListener2 {
  
  private CameraBridgeViewBase mOpenCvCameraView;
  
  private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
      @Override
      public void onManagerConnected(int status) {
          switch (status) {
              case LoaderCallbackInterface.SUCCESS:
              {
                 // Log.i(TAG, "OpenCV loaded successfully");
                  mOpenCvCameraView.enableView();
              } break;
              default:
              {
                  super.onManagerConnected(status);
              } break;
          }
      }
  };
  
  @Override
  public void onResume()
  {
      super.onResume();
      OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this,     mLoaderCallback);
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
       setContentView(R.layout.helloopencvlayout);
       mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.HelloOpenCvView);
       mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
       mOpenCvCameraView.setCvCameraViewListener((CvCameraViewListener2) this);
  
  }
  
  @Override
   public void onPause()
   {
       super.onPause();
       if (mOpenCvCameraView != null)
           mOpenCvCameraView.disableView();
   }
  
   public void onDestroy() {
       super.onDestroy();
       if (mOpenCvCameraView != null)
           mOpenCvCameraView.disableView();
   }
  
   public void onCameraViewStarted(int width, int height) {
   }
  
   public void onCameraViewStopped() {
   }
  
   public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
       return inputFrame.rgba();
  
   }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  }
  </code></pre>
  
  <p>Now if i try to call this from another activity using intent in which i just have a button and onclick method is implemented and when the button is pressed , this activity is called , the application crashes.</p>
  
  <p>It's been more the 4 hours , i am struggling with it. Please help and thanks in advance. </p>
  
  <p>What i believe is that there is a callback method implemented , so we can't call this activity as normal activity call , or may be some other concept. I search it on the internet , but nothing helps. Some where i also found the concept of Async call , but i didn't get it.</p>
  
  <p>Please help.
  Thanks.</p>