Android application crashes due to low memory
<p>My application is basically a image viewer. It is opened from both camera and as a separate application.</p>

<p>I open the image viewer to view and edit the picture. Each edit operation is implemented using thread. If my application closes due to pressing the home button, the next time I open it with camera. It throws anr.</p>

<p>This doesn't always happen. Only when large edit operations or edit operations on large image files are done.</p>

<p>I get out of memory error, sometimes timeout.</p>

<p>I guess it s because the thread doesn't complete the edit operation when home is clicked. and it s still running on the background. so when i open it s unable to process it.</p>

<p>m I right?</p>

<p>If so what is the way to stop a thread before the completion/</p>

<p>Can u pls help me out? </p>
