@@ -554,6 +554,8 @@ public static RequestManager with(@NonNull Context context) {
554554 * @deprecated This is equivalent to calling {@link #with(Context)} using the application context.
555555 * Use the androidx Activity class instead (ie {@link FragmentActivity}, or {@link
556556 * androidx.appcompat.app.AppCompatActivity}).
557+ * @throws IllegalArgumentException if the activity associated with the Glide request is being
558+ * destroyed.
557559 */
558560 @ NonNull
559561 @ Deprecated
@@ -566,8 +568,9 @@ public static RequestManager with(@NonNull Activity activity) {
566568 * androidx.fragment.app.FragmentActivity}'s lifecycle and that uses the given {@link
567569 * androidx.fragment.app.FragmentActivity}'s default options.
568570 *
569- * @param activity The activity to use.
571+ * @param activity The activity to use. The activity must not be destroyed.
570572 * @return A RequestManager for the given FragmentActivity that can be used to start a load.
573+ * @throws IllegalArgumentException if the activity is being destroyed.
571574 */
572575 @ NonNull
573576 public static RequestManager with (@ NonNull FragmentActivity activity ) {
@@ -580,6 +583,7 @@ public static RequestManager with(@NonNull FragmentActivity activity) {
580583 *
581584 * @param fragment The fragment to use.
582585 * @return A RequestManager for the given Fragment that can be used to start a load.
586+ * @throws IllegalArgumentException if the activity associated with the fragment is destroyed.
583587 */
584588 @ NonNull
585589 public static RequestManager with (@ NonNull Fragment fragment ) {
@@ -595,6 +599,7 @@ public static RequestManager with(@NonNull Fragment fragment) {
595599 * @deprecated This method is identical to calling {@link Glide#with(Context)} using the
596600 * application context. Prefer support Fragments and {@link #with(Fragment)} instead. See
597601 * https://github.com/android/android-ktx/pull/161#issuecomment-363270555.
602+ * @throws IllegalArgumentException if the activity associated with the fragment is destroyed.
598603 */
599604 @ Deprecated
600605 @ NonNull
@@ -628,6 +633,7 @@ public static RequestManager with(@NonNull android.app.Fragment fragment) {
628633 *
629634 * @param view The view to search for a containing Fragment or Activity from.
630635 * @return A RequestManager that can be used to start a load.
636+ * @throws IllegalArgumentException if the activity associated with the view is destroyed.
631637 */
632638 @ NonNull
633639 public static RequestManager with (@ NonNull View view ) {
0 commit comments