Where will this AsyncTask run?

Posted by Binoy Babu on Stack Overflow See other posts from Stack Overflow or by Binoy Babu
Published on 2012-06-23T00:40:35Z Indexed on 2012/06/23 3:16 UTC
Read the original article Hit count: 264

Filed under:

Say I have this code in the AlertDialog.Builder(context) of my application. The question is in which Thread will it run?

final Thread myPrettyOperation = new Thread() {
    @Override
    public void run() {
        //Do some really long operation.
    }
};
class MyPrettyTask extends
        AsyncTask<Void, Integer, Boolean> {
    protected Boolean doInBackground(
            Void... voids) {
        myPrettyOperation.start();
        return true;
    }
    protected void onProgressUpdate(
            Integer... progress) {
    }
    protected void onPostExecute(Boolean result) {
    }
}
new MyPrettyTask().execute();

© Stack Overflow or respective owner

Related posts about android