Null Pointer exception when trying to cancel Progress Dialog in AsyncTask in android
问题 I'm Getting a Null Pointer Exception while canceling the Progress Dialog in Async Task ..this is my code..I'm Getting Data from an RSS Conecction for 7 days of Week..I want to cancel the Dialog and stop the task if the user pressed Back Button. @Override protected void onPreExecute() { showDialog(DIALOG_PROGRESS); Calendar calendar = null; switch (day) { case SAT: calendar = DateUtil.getSaturdayDate(); break; case SUN: calendar = DateUtil.getSundayDate(); break; case MON: calendar = DateUtil