All Questions

619
votes
16answers
362952 views

Android "Only the original thread that created a view hierarchy can touch its views."

I've built a simple music player in Android. The view for each song contains a SeekBar, implemented like this: public class Song extends Activity implements OnClickListener,Runnable { private Se...
799
votes
16answers
606430 views

How to use threading in Python?

I am trying to understand threading in Python. I've looked at the documentation and examples, but quite frankly, many examples are overly sophisticated and I'm having trouble understanding them. How ...
306
votes
13answers
413685 views

How do you kill a thread in Java?

How do you kill a thread in Java?
294
votes
16answers
324689 views

How can one use multi threading in PHP applications

Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could force the operating system to load another i...
218
votes
7answers
141719 views

Running multiple AsyncTasks at the same time -- not possible?

I'm trying to run two AsyncTasks at the same time. (Platform is Android 1.5, HTC Hero.) However, only the first gets executed. Here's a simple snippet to describe my problem: public class AndroidJunk...
227
votes
14answers
239174 views

The application may be doing too much work on its main thread

I am new to Android SDK/API environment. It's the first I am trying to draw a plot/chart. I tried running different kinds of sample codes the emulator using 3 different free libraries, nothing is show...
72
votes
4answers
31417 views

How to run a background task in a servlet based web application?

I'm using Java and I want to keep a servlet continuously running in my application, but I'm not getting how to do it. My servlet has a method which gives counts of the user from a database on a daily ...
152
votes
11answers
145100 views

Timeout on a function call

I'm calling a function in Python which I know may stall and force me to restart the script. How do I call the function or what do I wrap it in so that if it takes longer than 5 seconds the script ca...
64
votes
11answers
42246 views

How to stop BackgroundWorker on Form's Closing event?

I have a form that spawns a BackgroundWorker, that should update form's own textbox (on main thread), hence Invoke((Action) (...)); call. If in HandleClosingEvent I just do bgWorker.CancelAsync() then...
9
votes
2answers
8757 views

JTextFields on top of active drawing on JPanel, threading problems

Has anyone ever tried to use Swing to construct a proper multi-buffered rendering environment on top of which Swing user interface elements can be added? In this case I have an animating red rectang...

Previous Next