Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is a classic job for an <code>AsyncTask</code>. from the <a href="http://developer.android.com/reference/android/os/AsyncTask.html" rel="nofollow">documentation</a>:</p> <blockquote> <p>AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.</p> </blockquote> <p>You won't need another activity or service for this.</p> <p>The <code>Asynctask</code> documentation has some sample code but in short, you would inherit from <code>AsyncTask</code> and override the <code>doInBackground</code> method to do the background stuff (guaranteed to run in a background thread). you might also want to call <code>publishProgress</code> from within this method to indicate you have progressed with your background operation. Then you'll return the computation result from this method (an XML buffer in your case).</p> <p>You might want to override the <code>OnProgressUpdate</code> and update a <code>ProgressBar</code> accordingly. This method will run in the UI thread in response to your <code>publishProgress</code> background method calls.</p> <p>Also you'd want to override the <code>onPostExecuteMethod</code> that is guaranteed to run after the background operation was finished on the main thread. You get the result of <code>doInBackground</code> as a parameter to this method.</p> <p>Note that this API is available for level 3 (android 1.5) and above.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload