Page Summary
-
The
MlKitclass is the public entry point for manually initializing ML Kit. -
ML Kit can be initialized using the
initializemethod, which takes aContextas a parameter. -
Manual initialization is typically only needed if the default content provider initialization is disabled.
-
The default content provider for initializing ML Kit can be disabled in the application manifest.
Public entry point to manually initialize ML Kit.
Public Method Summary
| static void |
Inherited Method Summary
Public Methods
public static void initialize (Context context)
Initializes ML Kit with the given context.
It is only necessary to call this method if you disable the content provider
declared in the manifest(e.g. when you want to use ML Kit feature in Application).
Under normal circumstances the content provider will automatically initialize ML Kit at
application startup.
How to disable ML Kit initialization content provider:
<provider
android:name="com.google.mlkit.common.internal.MlKitInitProvider"
android:authorities="${applicationId}.mlkitinitprovider"
tools:node="remove" />Parameters
| context | a Context
used to initialize ML Kit. This does not have to be the application context
itself. |
|---|