AsyncTask类VS AsyncTask对象

时间:2015-09-20 11:48:37

标签: java android performance android-asynctask inner-classes

无法找到以下哪种使用AsyncTask技术更好(性能明智,内存管理,设计明智)的问题的答案?

对象示例

class AsyncTaskObjectExample {

    protected AsyncTask<String, Integer, Boolean> asyncTaskObject = new AsyncTask<String, Integer, Boolean>() {
        @Override
        protected Boolean doInBackground(String... params) {
            /* YOUR PROCESSES */
            return true;
        }
    };
}

课程示例

class AsyncTaskClassExample {

    class AsyncTaskClass extends AsyncTask<String, Integer, Boolean> {
        @Override
        protected Boolean doInBackground(String... params) {
            /* YOUR PROCESSES */
            return true;
        }
    }
}

0 个答案:

没有答案