Handling onBackPressed with subtasks