mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-21 13:23:22 +01:00
23 lines
760 B
Java
23 lines
760 B
Java
package com.google.android.material.internal;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.content.ContextWrapper;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.RestrictTo;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
/* loaded from: classes7.dex */
|
|
public class ContextUtils {
|
|
@Nullable
|
|
public static Activity getActivity(Context context) {
|
|
while (context instanceof ContextWrapper) {
|
|
if (context instanceof Activity) {
|
|
return (Activity) context;
|
|
}
|
|
context = ((ContextWrapper) context).getBaseContext();
|
|
}
|
|
return null;
|
|
}
|
|
}
|