gpt4 book ai didi

android - 当我编写 thread.stop() 时,这个日志是什么?

转载 作者:行者123 更新时间:2023-11-29 14:22:21 25 4
gpt4 key购买 nike

10-18 10:26:39.382: ERROR/global(13919): Deprecated Thread methods are not supported.
10-18 10:26:39.382: ERROR/global(13919): java.lang.UnsupportedOperationException
10-18 10:26:39.382: ERROR/global(13919): at java.lang.VMThread.stop(VMThread.java:85)
10-18 10:26:39.382: ERROR/global(13919): at java.lang.Thread.stop(Thread.java:1379)
10-18 10:26:39.382: ERROR/global(13919): at java.lang.Thread.stop(Thread.java:1344)
10-18 10:26:39.382: ERROR/global(13919): at spexco.hus.camera.Camera.cancel(Camera.java:273)
10-18 10:26:39.382: ERROR/global(13919): at spexco.hus.cepvizyon.ViewCam.onStop(ViewCam.java:83)
10-18 10:26:39.382: ERROR/global(13919): at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1169)
10-18 10:26:39.382: ERROR/global(13919): at android.app.Activity.performStop(Activity.java:3797)
10-18 10:26:39.382: ERROR/global(13919): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3416)
10-18 10:26:39.382: ERROR/global(13919): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3487)
10-18 10:26:39.382: ERROR/global(13919): at android.app.ActivityThread.access$2800(ActivityThread.java:119)
10-18 10:26:39.382: ERROR/global(13919): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1896)
10-18 10:26:39.382: ERROR/global(13919): at android.os.Handler.dispatchMessage(Handler.java:99)
10-18 10:26:39.382: ERROR/global(13919): at android.os.Looper.loop(Looper.java:123)
10-18 10:26:39.382: ERROR/global(13919): at android.app.ActivityThread.main(ActivityThread.java:4363)
10-18 10:26:39.382: ERROR/global(13919): at java.lang.reflect.Method.invokeNative(Native Method)
10-18 10:26:39.382: ERROR/global(13919): at java.lang.reflect.Method.invoke(Method.java:521)
10-18 10:26:39.382: ERROR/global(13919): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
10-18 10:26:39.382: ERROR/global(13919): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
10-18 10:26:39.382: ERROR/global(13919): at dalvik.system.NativeStart.main(Native Method)

最佳答案

我认为它相当清楚:Thread.stop 是一个已弃用的 API,Android 不支持已弃用的线程方法。因此它抛出一个 UnsupportedOperationException

答案是不使用 Thread.stop - 以更优雅的方式关闭线程,例如通过设置线程定期检查的标志。

关于android - 当我编写 thread.stop() 时,这个日志是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3957253/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com