如何获得Android的线程ID? [英] How to get Android Thread ID?
问题描述
这code抛出给定的主题不存在当我尝试使用它在一个线程异常:
android.os.Process.getThreadPriority((INT)Thread.currentThread()的getId()));
同上,如果我尝试使用Process.setThreadPriority,使用java类线程ID。我也注意到,这种不匹配在调试器中显示的线程ID。我如何获取Android特定线程ID,才能使用此API?
android.os.Process.getThreadPriority(android.os.Process.myTid());
有关进一步参考
<一个href="http://developer.android.com/reference/android/os/Process.html#myTid()">http://developer.android.com/reference/android/os/Process.html#myTid()
This code throws a "Given thread does not exist" exception when I try to use it in a thread:
android.os.Process.getThreadPriority((int) Thread.currentThread().getId()));
Ditto if I try to use Process.setThreadPriority, using the java class Thread id. I've also noticed that this does not match the thread id displayed in the debugger. How do I get the Android specific thread id, in order to use this API?
android.os.Process.getThreadPriority(android.os.Process.myTid());
For further reference
http://developer.android.com/reference/android/os/Process.html#myTid()
这篇关于如何获得Android的线程ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!