androud java.lang.IllegalThreadStateException

錯誤日誌:java

FATAL EXCEPTION: main
 java.lang.IllegalThreadStateException: Thread already started.
     at java.lang.Thread.start(Thread.java:1045)
     at com.yaloe.sdk.video.Video.surfaceCreated(Video.java:41)
     at android.view.SurfaceView.updateWindow(SurfaceView.java:544)
     at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:226)
     at android.view.View.dispatchWindowVisibilityChanged(View.java:7425)
     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1042)
     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1042)
     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1042)
     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1042)
     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1042)
     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1220)
     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4216)
     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
     at android.view.Choreographer.doCallbacks(Choreographer.java:555)
     at android.view.Choreographer.doFrame(Choreographer.java:525)
     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
     at android.os.Handler.handleCallback(Handler.java:615)
     at android.os.Handler.dispatchMessage(Handler.java:92)
     at android.os.Looper.loop(Looper.java:137)
     at android.app.ActivityThread.main(ActivityThread.java:4794)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:511)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
     at dalvik.system.NativeStart.main(Native Method)
解決辦法:android

Thread t1=null;
app

if(T1 != null){     ide

    if(T1.isAlive())return;  oop

}  spa

T1 = new Thread(camThread);  日誌

T1.start(); 
orm

相關文章
相關標籤/搜索