android intent at oncameraframe

asked 2015-03-19 08:15:29 -0600

hello i try to send intent in oncameraframemethod.

this is my intent:

Intent intent = new Intent(getApplicationContext(),ColorBlobDetectionActivity.class);
                startActivity(intent);

but it make this error :

5911-6350/tpproject.amirhosseinmafi.com.mycamera E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-8993
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
        at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6818)
        at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1112)
        at android.view.ViewGroup.invalidateChild(ViewGroup.java:4484)
        at android.view.View.invalidate(View.java:11396)
        at android.view.View.setFlags(View.java:9479)
        at android.view.View.setVisibility(View.java:6094)
        at android.view.SurfaceView.setVisibility(SurfaceView.java:244)
        at tpproject.amirhosseinmafi.com.mycamera.Second.onCameraFrame(Second.java:156)
        at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:387)
        at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:328)
        at java.lang.Thread.run(Thread.java:841)

what can i do to send intent?????

edit retag flag offensive close merge delete