android UI线程的线程优先级是什么?

rbl8hiat  于 2023-02-02  发布在  Android
关注(0)|答案(2)|浏览(148)

UI线程的线程优先级是多少?是5吗?Thread.NORM_PRIORITY?我想运行一个高优先级的线程,但不想它的优先级高于UI线程。

umuewwlo

umuewwlo1#

我写了这行字:

Log.d(TAG, "The priority of the main thread is ${android.os.Process.getThreadPriority(0)}")

在onResume中,并在日志目录中获得以下内容:

The priority of the main thread is -10
7gyucuyw

7gyucuyw2#

一个普通的AsyncTask或不同的后台服务通常就足够了。

相关问题