Here is my process and problem:
In this application you click a Menu button
From this Menu you press a toggle button, which starts an Async-Task (makes a tone sound every 30 seconds). This task is to run constantly when the toggle is checked, and cancel when it is unchecked. This work's fine to start and stop the process as long as you remain in the Menu window.
Check the toggle box!
If the window is peeled back and Menu is opened again, my save state for the toggle is Checked and the process is still running. However I THINK I lost access to that instance of the Async Task. Which might be why unchecking the toggle will then crash the program?
myTask.cancle(true); may be like a lost reference and my Asynch-Task is now flowing out in the void where I can no longer call to or control it!
What can I do to grab the Async task and cancel it in this situation?
TL,DR; If I spawn an async task from one activity (mTask = new ...), but then leave that activity, how can I still access mTask?