// pressing back button finishes this activity public void onBackPressed() { // writeProgress(completed_downloads,total_files_to_download); downloadThread.requestStop(); super.onBackPressed(); // download_photos.this.finish(); }