mirror of https://github.com/ThmmyNoLife/mTHMMY
Ezerous
5 years ago
3 changed files with 39 additions and 12 deletions
@ -0,0 +1,17 @@ |
|||||
|
package gr.thmmy.mthmmy.utils.ui; |
||||
|
|
||||
|
import android.app.Activity; |
||||
|
import android.content.Context; |
||||
|
|
||||
|
public class GlideUtils { |
||||
|
public static boolean isValidContextForGlide(final Context context) { |
||||
|
if (context == null) |
||||
|
return false; |
||||
|
|
||||
|
if (context instanceof Activity) { |
||||
|
final Activity activity = (Activity) context; |
||||
|
return !activity.isDestroyed() && !activity.isFinishing(); |
||||
|
} |
||||
|
return true; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue