Show Loading Dialog When Making A HTTP Request in Android
<p>In an effort to learn Android I am writing a small app. The first thing I am trying to do is login via a remote API.</p>

<p>I would like to show a "loading" dialog when the call is being made (in case he user in using mobile internet). Researching this has shown two possible methods.</p>

<p>One is to use a <strong>ProgressDialog</strong> and a private class that extends <strong>Thread</strong>, the other is using a private class that extends <strong>AsyncTask</strong>.</p>

<p>Which is best/more appropriate for this task? </p>

<p>I have tried using the ProgressDialog version but am struggling. I have put the function making the http request in the extended Thread run() method, but am unsure on how to pass the response data (JSON) back into my activity.</p>

<p>Any and all help gratefully received.</p>
