Safely executing a function in a not-thread-safe class (Android Camera)
<p>I'm using the callback <code>onPreviewFrame</code> for my application, but it causes problems when I try to exit the activity. Without the callback, clicking <code>back</code> has no issues, but with the callback, clicking <code>back</code> will alert me that a call has been made after <code>release()</code> on the camera object has been executed.</p>

<p>Note: the callback is threaded (I believe this is the default implementation), and continues to try to access the camera object after it's been killed.</p>

<p>How can I safely exit the activity without this callback causing me problems? If you'd like to see code I can post some.</p>
