So, I've been trying to follow the instructions to have any heavy work
take place on a separate thread from the UI, but whatever I do it
doesn't seem to be executing on a second thread. (At the moment I only
have the emulator to work with.)
I've tried several different ways. At the moment my code looks like:
confirmButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
pd = ProgressDialog.show(gui, "Working...",
"Calculating");
messageHandler.post(calcThread);
}
});
Upon clicking my button, my thread begins. Here is some pseudo code of
my thread:
private Thread calcThread = new Thread(){
@Override
public void run() {
running = true;
super.run();
//Send update to the main thread
messageHandler.sendEmptyMessage(0);
}
};
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---