 } else {
        // display error
    }
    ...
}</pre>

<h2 id="AsyncTask">Perform Network Operations on a Separate Thread</h2>

<p>Network operations can involve unpredictable delays. To prevent this from
causing a poor user experience, always perform network operations on a separate
thread from the UI. The <code><a href="../../../reference/android/os/AsyncTask.html">AsyncTask</a></code> class provides one of the
simplest ways to fire off a new task from the UI thread. For more discussion of
this topic, 