@Override public void onPreExecute() { if (mThreadId == null) { if (Constants.LOGGING) Log.e(TAG, "mSettings.threadId == null"); this.cancel(true); return; } synchronized (mCurrentDownloadCommentsTaskLock) { if (mCurrentDownloadCommentsTask != null) { this.cancel(true); return; } mCurrentDownloadCommentsTask = this; } if (isInsertingEntireThread()) { if (mActivity.mCommentsAdapter != null) mActivity.mCommentsAdapter.clear(); else mActivity.resetUI(null); // Do loading screen when loading new thread; otherwise when "loading more comments" don't // show it mActivity.enableLoadingScreen(); } if (mContentLength == -1) mActivity .getWindow() .setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_INDETERMINATE_ON); if (mThreadTitle != null) mActivity.setTitle(mThreadTitle + " : " + mSubreddit); }