Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run my code on the specific thread?

How to run my code on the specific thread?

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

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

"the specific thread" is made by some library.

But I can access "the specific thread".

Like this, Thread theSpecificThread = getThread();

How to run my code on the specific thread like runOnUiThread(new Runnable())?

like image 529
ChangUZ Avatar asked Jul 06 '12 02:07

ChangUZ


1 Answers

You have to arrange for the thread to call it. If this thread is buried in an opaque library, doesn't call any accessible methods or events and provides no way of signaling it to do something you can get at, then I'm afraid that you have a big problem.

like image 75
Martin James Avatar answered Oct 04 '22 16:10

Martin James