Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>doInBackground() runs on the background thread. So you cannot make changes to the ui on the background thread. You need to make changes or update ui on the ui thread.</p> <p><a href="http://developer.android.com/reference/android/os/AsyncTask.html" rel="nofollow noreferrer">http://developer.android.com/reference/android/os/AsyncTask.html</a></p> <p>When an asynchronous task is executed, the task goes through 4 steps:</p> <ol> <li><p>onPreExecute(), invoked on the UI thread before the task is executed. This step is normally used to setup the task, for instance by showing a progress bar in the user interface.</p></li> <li><p>doInBackground(Params...), <strong>invoked on the background thread immediately after onPreExecute() finishes executing</strong>. <strong>This step is used to perform background computation that can take a long time</strong>. The parameters of the asynchronous task are passed to this step. The result of the computation must be returned by this step and will be passed back to the last step. This step can also use publishProgress(Progress...) to publish one or more units of progress. These values are published on the UI thread, in the onProgressUpdate(Progress...) step.</p></li> <li><p>onProgressUpdate(Progress...), invoked on the UI thread after a call to publishProgress(Progress...). The timing of the execution is undefined. This method is used to display any form of progress in the user interface while the background computation is still executing. For instance, it can be used to animate a progress bar or show logs in a text field.</p></li> <li><p>onPostExecute(Result), invoked on the UI thread after the background computation finishes. The result of the background computation is passed to this step as a parameter.</p></li> </ol> <p>Use runonuithread or update ui in onPostExecute() depending on the result returned in doInbackground().</p> <p>Check the link below</p> <p><a href="https://stackoverflow.com/questions/15757251/doing-ui-task-in-doinbackground-in-android">Doing UI task in doinbackground() in Android</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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