How to run my code in a specific thread?

How to run my code in a specific thread?

If the "specific thread" is the main ui Thread, I can use the runOnUiThread method.

But the "specific thread" is not ui Thread and the "specific thread" is not made by me.

a "specific thread" is created by some library.

But I can access the "specific thread".

Similarly Thread theSpecificThread = getThread();

How to run my code in a specific thread like runOnUiThread (new Runnable ())?

+7
source share
1 answer

You need to configure the thread to call it. If this thread is buried in an opaque library, it does not call any available methods or events and does not give any signals to signal that you can do something that you can get, then I am afraid that you have a big problem.

+1
source

All Articles