public final class OptionalInjectCheck
extends java.lang.Object
AndroidEntryPoint
-annotated
class that is also annotated with OptionalInject
was injected by Hilt.OptionalInject
Modifier and Type | Method and Description |
---|---|
static boolean |
wasInjectedByHilt(android.content.BroadcastReceiver broadcastReceiver)
Returns true if the BroadcastReceiver was injected by Hilt.
|
static boolean |
wasInjectedByHilt(androidx.activity.ComponentActivity activity)
Returns true if the Activity was injected by Hilt.
|
static boolean |
wasInjectedByHilt(androidx.fragment.app.Fragment fragment)
Returns true if the Fragment was injected by Hilt.
|
static boolean |
wasInjectedByHilt(android.app.Service service)
Returns true if the Service was injected by Hilt.
|
static boolean |
wasInjectedByHilt(android.view.View view)
Returns true if the View was injected by Hilt.
|
public static boolean wasInjectedByHilt(@NonNull androidx.activity.ComponentActivity activity)
java.lang.IllegalArgumentException
- if the given instance is not an AndroidEntryPoint nor is
annotated with OptionalInject
.public static boolean wasInjectedByHilt(@NonNull android.content.BroadcastReceiver broadcastReceiver)
java.lang.IllegalArgumentException
- if the given instance is not an AndroidEntryPoint nor is
annotated with OptionalInject
.public static boolean wasInjectedByHilt(@NonNull androidx.fragment.app.Fragment fragment)
java.lang.IllegalArgumentException
- if the given instance is not an AndroidEntryPoint nor is
annotated with OptionalInject
.public static boolean wasInjectedByHilt(@NonNull android.app.Service service)
java.lang.IllegalArgumentException
- if the given instance is not an AndroidEntryPoint nor is
annotated with OptionalInject
.public static boolean wasInjectedByHilt(@NonNull android.view.View view)
java.lang.IllegalArgumentException
- if the given instance is not an AndroidEntryPoint nor is
annotated with OptionalInject
.