title: Android Glide Error:You cannot start a load for a destroyed activity
body: <p>i am using glide to view images which am getting as url from database in my activity,and i am deleting an image in activity where after deleting next activity will be opened but first time the image is deleting without any error,second time if  open to and press delete I am getting this error:</p>
  
  <pre><code>java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity
  </code></pre>
  
  <p>This is my code to delete the image:</p>
  
  <pre><code>alert.setNegativeButton("Delete", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(final DialogInterface dialogInterface, final int i) {
                      try {
                          final Query postRef = ref.child("Pendingevents").orderByChild("Eventtitle").equalTo(Title);
  
  
                          postRef.addListenerForSingleValueEvent(new ValueEventListener() {
                              @Override
                              public void onDataChange(DataSnapshot dataSnapshot) {
  
                                  for (DataSnapshot child : dataSnapshot.getChildren()) {
                                      child.getRef().removeValue();
  
                                      Toast.makeText(getApplicationContext(), "Event Deleted", Toast.LENGTH_SHORT).show();
  
                                      Intent intent=new Intent(getApplicationContext(),PendingEvents.class);
                                      intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                                      startActivity(intent);
                                  }
  
  
                              }
  
                              @Override
                              public void onCancelled(DatabaseError firebaseError) {
  
                              }
                          });
  
                      }catch (Exception e)
                      {
                          Toast.makeText(ApproveEvents.this, "Unknown      Error,please Try Again", Toast.LENGTH_SHORT).show();
                      }
                  }
              });
              AlertDialog build=alert.create();
              build.show();
          }
      });
  </code></pre>
  
  <p>Logcat:</p>
  
  <pre><code>java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity
                                                                                at com.a.a.e.o.b(Unknown Source)
                                                                                at com.a.a.e.o.a(Unknown Source)
                                                                                at com.a.a.f.a(Unknown Source)
                                                                                at bootcamplearning.humanplanet.u.a(Unknown Source)
                                                                                at com.google.android.gms.b.ol.a(Unknown Source)
                                                                                at com.google.android.gms.b.qh.b(Unknown Source)
                                                                                at com.google.android.gms.b.qn.run(Unknown Source)
                                                                                at android.os.Handler.handleCallback(Handler.java:739)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                at android.os.Looper.loop(Looper.java:135)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5294)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
  </code></pre>