Handling UI code from a Thread
<p>I know how to use handlers to update UI elements such as progress bars toasts etc.</p>

<p>The problem I am having is when the context goes away such as the user pressing the back button or the Activity finishing for some reason.  This causes my application to crash often.</p>

<p>I tried using getApplicationContext() (Thinking that this would be available throughout my entire application) but this did not work, ever - instead my application crashed!</p>

<p>I put try catch blocks around all UI update code, this works but is it necessary?</p>

<p>So...what is the bast way to handle this?</p>
