Top "Runnable" questions

The Runnable interface defines a single method, run, meant to contain the code executed in the thread.

Why do variables passed to runnable need to be final?

If I have a variable int x = 1, say, and I declare a runnable in the main thread, and I want …

java variables final runnable
Handler.postDelayed(...) does not delay the Runnable

i've implemented an OnCompletionListener by myself which looks like this: public class SongEndCompletionListener implements OnCompletionListener{ String nextView; Context actualActivity; int …

android android-mediaplayer runnable android-handler postdelayed
The method runOnUiThread(Runnable) in the type Activity is not applicable for the arguments (void)

I am trying to create a dialog from a non-UI thread, in onUtteranceCompleted(): runOnUiThread( new Thread(new Runnable() { public void …

android dialog thread-safety runnable ui-thread
ScheduledThreadPoolExecutor, how stop runnable class JAVA

I have written the following code: import java.util.Calendar; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; …

java runnable
Can a Runnable return a value?

Is it possible for a Runnable to return a value? I need to do some intensive work on an Editable …

android multithreading runnable
Schedule Java task for a specified time

I would like to be able to schedule a task at a specific time in Java. I understand that the …

java scheduled-tasks runnable executor
Getting a result in the future?

I'm looking to get a result from a method which can take a while to complete and doesn't actually return …

java asynchronous runnable callable futuretask
How-to use Runnable in Mono for android

I'm try to lern Monodroid! I try to re-write java code to C# and have some problem: I don't understand …

c# xamarin.android runnable
runOnUiThread(new Runnable() { punctuation (token) issue

Somehow it doesn't work, according to me it should be this: public void Splash(){ Timer timer= new Timer(); timer.schedule(…

android runnable timertask punctuation android-runonuithread
Implicit conversion to Runnable?

As an exercise, I tried to create an implicit conversion that would accept a function and produce a Runnable. That …

scala runnable implicit-conversion