Can't get an OnClickListener to interrupt a running process

Put your problem here if it does not fit any of the other categories.

Can't get an OnClickListener to interrupt a running process

Postby RueTheDay » Sun Apr 26, 2009 1:08 am

I'm new to Android. I'm trying to write a very simple interval timer app. There are two buttons on the activity, one starts a process. This works fine. The other is supposed to stop the process if clicked, but I can't figure out how to interrupt it. In fact, running on the emulator, it seems to want to ignore any clicking on the Cancel button entirely.



At first I tried to just stop the MediaPlayers, then I tried to create a flag variable and set it. The problem is that once "start()" has been called, it seems to want to ignore any other button clicks. Please help. Thanks.

Edit: Nevermind, I had to create a thread to deal with the timer so control could be returned to the UI.
RueTheDay
Freshman
Freshman
 
Posts: 3
Joined: Sun Apr 26, 2009 1:00 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 21 guests