@Override protected void onResume() { super.onResume(); BasicProgressAsyncTask<?, ?, ?> t = downloadListIndexThread.getCurrentRunningTask(); updateProgress(false); if (t instanceof DownloadIndexesThread.DownloadIndexesAsyncTask) { View mainView = findViewById(R.id.MainLayout); if (mainView != null) { mainView.setKeepScreenOn(true); } } }