runnable Questions

1

I want to start a new activity, the activity plays a live stream from a source. When I start the activity, it plays the content on the whole screen. I want to display the contents of the stream in ...
Bakery asked 30/1, 2014 at 12:48

3

Solved

Is it possible to return a value after Activity.runOnUiThread() method. runOnUiThread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub int var = SOMETHING; ...
Stereotype asked 28/1, 2014 at 12:55

4

Solved

In a subclass of WebView, I have this in an overridden method of getTitle(): @Override public String getTitle() { Activity a = getVoTts().getActivity(); a.runOnUiThread(new Runnable() { publi...
Plaided asked 1/1, 2013 at 21:1

4

Solved

The Android Developers site states that two rules must be followed when working in the UI thread, i.e., Do not block the UI thread Do not access the Android UI toolkit from outside the UI thread*...
Precancel asked 9/9, 2013 at 15:58

4

Solved

On stackoverflow, I often see the use of Thread.currentThread().isInterrupted(). When implementing Runnable and using it in a while loop, like so: public void run() { while(!Thread.currentThread(...
Baloney asked 4/6, 2013 at 11:6

1

I've read a few discussions about which thread calls various callback methods, for example those associated with Sensors. Most claim that the UI thread calls the callbacks - even when a separate wo...
Shriner asked 16/7, 2013 at 16:18

3

I use a Handler, which post some Runnable via postDelayed(r, DELAY_TIME), but I need to execute all Runnables before posting new via postDelayed. Any good ideas how to achieve this as simple as po...
Valorize asked 26/4, 2013 at 19:58

5

Solved

I have a thread that uses a handler to post a runnable instance. it works nicely but I'm curious as to how I would pass params in to be used in the Runnable instance? Maybe I'm just not under...
Giddens asked 3/2, 2012 at 3:25

3

Solved

I want to have two separate threads running two different instances of different classes and I want them to execute the run command at the same time. I've made a practice class to demonstrate the ...
Senary asked 19/4, 2013 at 7:59

1

Which is easier and more suitable to use for running things in another thread, notably so that the program waits for the result but doesn't lock up an ui. There may be a method that is better than...
Duma asked 12/4, 2013 at 20:57

5

Solved

The Java Thread itself implements a Java Runnable! and according to most of the experts over Internet, implements Runnable is preferred over extends Thread! even though we cannot use utilize ...
Knight asked 18/3, 2013 at 7:10

2

In my program I made an assert - which evaluates to false - from a runnable, but never see any console output about the assert. I want to know if my asserts are false, but it seems the runnable is ...
Melvamelvena asked 15/1, 2013 at 18:58

2

Solved

Thread t = new Thread(new Runnable() { public void run() {} }); I'd like to create a thread this way. How can I pass parameters to the run method if possible at all? Edit: To make my problem spe...
Blest asked 17/12, 2012 at 8:16

1

I want to pass a Runnable into an activity via bundle, so that runnable must run when onCreate fires. I wrote a class which implements Serializable but it causes exception: "java.lang.RuntimeExcept...
Oedema asked 16/12, 2012 at 8:41

3

Solved

I am trying to establish a runnable which can load ads by every 5 sec interval (of course 5 sec is too fast, it's just for testing purpose) Here is my code: package com.admobsdk_dfp_handler; imp...
Collusive asked 26/11, 2012 at 7:14

1

Solved

I recently refactored an old project and found that a particular portion no longer wants to run properly no matter what I do. Essentially, I have an Activity with a TextView. This view is updated a...
Internationale asked 25/11, 2012 at 6:59

2

Solved

What is "runnable" in Java, in layman's terms? I am an AP programming student in high school, whose assignment is to do research, or seek out from others what "runnable" is (we are just getti...
Mcsweeney asked 11/11, 2012 at 0:45

4

I am wondering if it is possible in java to have a class that implements Runnable and if an object of the class goes to wait() (so thread stops running until it receives a signal), can another obje...
Preadamite asked 21/10, 2012 at 6:31

6

Solved

This simple issue confuses me. You can display a JAVA GUI application by setting the frames' setVisible property true. But in almost all the examples I found on internet they use a separate thread ...
Rubie asked 1/10, 2012 at 3:10

5

Solved

I'm developing a multithreaded application to make connections to external servers - each on separate threads - and will be blocked until there is input. Each of these extends the Thread class. For...
Halfbeak asked 1/9, 2012 at 19:15

2

Solved

How can I access Thread object that is executing given Runnable? What I'd like to do is to call sleep() from within run() method.
Geode asked 13/8, 2012 at 14:29

6

Solved

I am starting multiple threads(around 1000) from my code. They are Runnable threads called from a while loop. How do I calculate the total time taken for all threads to finish executing? Also I am...
Incommensurable asked 8/8, 2012 at 7:17

3

Solved

If I have a variable int x = 1, say, and I declare a runnable in the main thread, and I want to pass x to the runnable's run() method, it must be declared final. Why? final int x = 0;//<----mus...
Raggletaggle asked 11/7, 2012 at 2:33

3

Solved

say I do the following... //MyRunnable is a class that I have declared, which implements Runnable. MyRunnable r = new MyRunnable(); Thread t = new Thread(r); t.start(); r = null; What are the ...
Lionhearted asked 13/6, 2012 at 9:12

2

Solved

I have the following Java code: public static void main(String[] args) { new Thread(new MyRunnable()).run(); showGUI(); } My problem is that starting MyRunnable blocks the main thread, causing...
Kaplan asked 21/4, 2012 at 6:42

© 2022 - 2024 — McMap. All rights reserved.