# SplitInstallManager

Summary:[Methods](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager#pubmethods)  

# SplitInstallManager

`
public


interface
SplitInstallManager
`  
`


`

|---------------------------------------------------------------|
| com.google.android.play.core.splitinstall.SplitInstallManager |

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [FakeSplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html) |---------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | [FakeSplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html) | A fake implementation of the[SplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html). | |

<br />

*** ** * ** ***

Manages sessions for requesting and installing split APKs for additional features or language resources.

To learn more, read[Request an on demand module](https://d.android.com/guide/playcore/dynamic-delivery#request).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[cancelInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#cancelInstall(int))`(int sessionId) ` Starts a request to cancel a pending split install.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#deferredInstall(java.util.List<java.lang.String>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`> moduleNames) ` Defers installation of given`moduleNames`.                                                                                                                                                                                                                                                                                                                                                                                               |
| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredLanguageInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#deferredLanguageInstall(java.util.List<java.util.Locale>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[Locale](https://developer.android.com/reference/java/util/Locale.html)`> languages) ` Defers installation of given`languages`.                                                                                                                                                                                                                                                                                                                                                                                   |
| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredLanguageUninstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#deferredLanguageUninstall(java.util.List<java.util.Locale>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[Locale](https://developer.android.com/reference/java/util/Locale.html)`> languages) ` Defers uninstallation of given`languages`.                                                                                                                                                                                                                                                                                                                                                                             |
| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredUninstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#deferredUninstall(java.util.List<java.lang.String>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`> moduleNames) ` Defers uninstallation of given`moduleNames`.                                                                                                                                                                                                                                                                                                                                                                                         |
| ` abstract `[Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>`                                                                                                                                                                        | ` `[getInstalledLanguages](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getInstalledLanguages())`() ` Returns the languages that are currently installed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` abstract `[Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>`                                                                                                                                                                        | ` `[getInstalledModules](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getInstalledModules())`() ` Returns the modules that are currently installed (excluding the base module).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>`                                                                        | ` `[getSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getSessionState(int))`(int sessionId) ` Returns the current state of a split install session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[List](https://developer.android.com/reference/java/util/List.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>>` | ` `[getSessionStates](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getSessionStates())`() ` Returns the state for all active sessions belonging to the app.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` abstract void`                                                                                                                                                                                                                                                                                                                  | ` `[registerListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#registerListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener))`(`[SplitInstallStateUpdatedListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallStateUpdatedListener.html)` listener) ` Registers a listener for your app that is alerted of state changes for module install requests.                                                                                                                                                                                                                                                                                    |
| ` abstract boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20com.google.android.play.core.common.IntentSenderForResultStarter,%20int))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, IntentSenderForResultStarter starter, int requestCode) ` Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html).                                    |
| ` abstract boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20androidx.activity.result.ActivityResultLauncher<androidx.activity.result.IntentSenderRequest>))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, ActivityResultLauncher<IntentSenderRequest> activityResultLauncher) ` Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html). |
| ` abstract boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20android.app.Activity,%20int))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, `[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, int requestCode) ` Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html).                            |
| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`>`                                                                                                                                          | ` `[startInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#startInstall(com.google.android.play.core.splitinstall.SplitInstallRequest))`(`[SplitInstallRequest](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallRequest.html)` request) ` Initiates a request to download and install split APKs for additional features or language resources.                                                                                                                                                                                                                                                                                                                              |
| ` abstract void`                                                                                                                                                                                                                                                                                                                  | ` `[unregisterListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#unregisterListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener))`(`[SplitInstallStateUpdatedListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallStateUpdatedListener.html)` listener) ` Unregisters a listener you previously registered using[registerListener(SplitInstallStateUpdatedListener)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#registerListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener)).                                                           |

## Public methods

### cancelInstall

```
public abstract Task<Void> cancelInstall (int sessionId)
```

Starts a request to cancel a pending split install.

[Cancelling requests](https://d.android.com/guide/playcore/dynamic-delivery#cancel_request)are best-effort. You can[monitor the request state](https://d.android.com/guide/playcore/dynamic-delivery#monitor_requests)to listening for the[SplitInstallSessionStatus.CANCELED](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#CANCELED)state.

<br />

|                                    Parameters                                    ||
|-------------|---------------------------------------------------------------------|
| `sessionId` | `int`: the sessionId of the request you would like to cancel <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### deferredInstall

```
public abstract Task<Void> deferredInstall (List<String> moduleNames)
```

Defers installation of given`moduleNames`. When called, the Play Store tries to eventually install those modules in the background.

If your app requires immediate access to a module,[request to install](https://d.android.com/guide/playcore/dynamic-delivery#request)the module in the foreground.

To learn more, read[Defer installation of on demand modules](https://d.android.com/guide/playcore/dynamic-delivery#deferred_install).

<br />

|                                          Parameters                                          ||
|---------------|-------------------------------------------------------------------------------|
| `moduleNames` | `List`: the names of the modules you want to install in the background <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### deferredLanguageInstall

```
public abstract Task<Void> deferredLanguageInstall (List<Locale> languages)
```

Defers installation of given`languages`. When called, the Play Store tries to eventually install those languages in the background.

To learn more, read[Download additional language resources](https://d.android.com/guide/playcore/dynamic-delivery#lang_resources).

<br />

|                                   Parameters                                    ||
|-------------|--------------------------------------------------------------------|
| `languages` | `List`: the languages you want to install in the background <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### deferredLanguageUninstall

```
public abstract Task<Void> deferredLanguageUninstall (List<Locale> languages)
```

Defers uninstallation of given`languages`. When called, the Play Store tries to eventually uninstall these languages from the app in the background.

To learn more, read[Uninstall additional language resources](https://d.android.com/guide/playcore/dynamic-delivery#uninstall_lang_resources).

<br />

|                                    Parameters                                     ||
|-------------|----------------------------------------------------------------------|
| `languages` | `List`: the languages you want to uninstall in the background <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### deferredUninstall

```
public abstract Task<Void> deferredUninstall (List<String> moduleNames)
```

Defers uninstallation of given`moduleNames`. When called, the Play Store tries to eventually remove those modules in the background.

These`moduleNames`will not be included when the app is updated, even if they are marked as available at install-time in the updated version of the app. For the app to regain access to the modules, the app must[request to install](https://d.android.com/guide/playcore/dynamic-delivery#request)the modules again, or make the module available at install-time under a new module name.

To learn more, read[Uninstall modules](https://d.android.com/guide/playcore/dynamic-delivery#uninstall_modules).

<br />

|                                           Parameters                                           ||
|---------------|---------------------------------------------------------------------------------|
| `moduleNames` | `List`: the names of the modules you want to uninstall in the background <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### getInstalledLanguages

```
public abstract Set<String> getInstalledLanguages ()
```

Returns the languages that are currently installed.

The app's default language is not included in the returned set.

Returns an empty set if an error occurs.

For Instant Apps, this API is not supported and the return value is undefined.

**Note:** Languages are considered installed even when they are emulated by[SplitCompat](https://developer.android.com/reference/com/google/android/play/core/splitcompat/SplitCompat.html)because they are accessible to the app.

**Note:** This method does NOT work if you are deploying your bundle onto your device from Android Studio via \`Run...\` or if you test it via Gradle's \`assemble\[Debug\|Release\|...\]\` or \`install\[Debug\|Release\|...\]\`. In such situation, this method always returns an empty list. The recommended way to test this method is by uploading your bundle to[Internal App Sharing](https://support.google.com/googleplay/android-developer/answer/9303479).

<br />

|                                                                                              Returns                                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>` | the languages that are currently installed <br /> |

### getInstalledModules

```
public abstract Set<String> getInstalledModules ()
```

Returns the modules that are currently installed (excluding the base module).

To learn more, read[Manage installed modules](https://d.android.com/guide/playcore/dynamic-delivery#manage_installed_modules).

**Note:** Modules are considered installed even when they are emulated by[SplitCompat](https://developer.android.com/reference/com/google/android/play/core/splitcompat/SplitCompat.html)because they are accessible to the app.

<br />

|                                                                        Returns                                                                         ||
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>` | <br /> |

### getSessionState

```
public abstract Task<SplitInstallSessionState> getSessionState (int sessionId)
```

Returns the current state of a split install session.

You should not use the session state to[determine whether a module is installed](https://d.android.com/guide/playcore/dynamic-delivery#manage_installed_modules). Instead, please use[getInstalledModules()](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getInstalledModules()).

To learn more, read[Monitor the request state](https://developer.android.com/guide/playcore/dynamic-delivery#monitor_requests).

<br />

|                                Parameters                                ||
|-------------|-------------------------------------------------------------|
| `sessionId` | `int`: the Id for the session you want to status for <br /> |

|                                                                                                                        Returns                                                                                                                         ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>` | <br /> |

### getSessionStates

```
public abstract Task<List<SplitInstallSessionState>> getSessionStates ()
```

Returns the state for all active sessions belonging to the app.

You should not use the session state to[determine whether a module is installed](https://d.android.com/guide/playcore/dynamic-delivery#manage_installed_modules). Instead, please use[getInstalledModules()](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getInstalledModules()).

To learn more, read[Monitor the request state](https://developer.android.com/guide/playcore/dynamic-delivery#monitor_requests).

<br />

|                                                                                                                                                            Returns                                                                                                                                                            ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[List](https://developer.android.com/reference/java/util/List.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>>` | <br /> |

### registerListener

```
public abstract void registerListener (SplitInstallStateUpdatedListener listener)
```

Registers a listener for your app that is alerted of state changes for module install requests.

You should unregister the listener using[unregisterListener(SplitInstallStateUpdatedListener)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#unregisterListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener))when the request is resolved. To learn more, read[Monitor the request state](https://d.android.com/guide/playcore/dynamic-delivery#monitor_requests).

<br />

|                                                                                                                       Parameters                                                                                                                       ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `listener` | `SplitInstallStateUpdatedListener`: the[SplitInstallStateUpdatedListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallStateUpdatedListener.html)you want to register for your app <br /> |

### startConfirmationDialogForResult

```
public abstract boolean startConfirmationDialogForResult (SplitInstallSessionState sessionState, 
                IntentSenderForResultStarter starter, 
                int requestCode)
```

Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html).

This method should be called if you are starting installation from a Component different from an`Activity`and you don't want to receive the`onActivityResult`call on the Activity.

For example, you can use it for`androidx.fragment.app.Fragment`:  

    startConfirmationDialogForResult(
       sessionState, fragment::startIntentSenderForResult, requestCode);
     
Similar to[Activity.startActivityForResult(Intent, int)](https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent,%20int)), this method is run "for result". The result from the confirmation dialog's Activity can be handled by the`onActivityResult`of the object that would normally receive an activity result when the`starter`'s`startIntentSenderForResult`is called. The result is tagged with the provided`requestCode`.

To learn more, read[Obtain user confirmation](https://d.android.com/guide/playcore/dynamic-delivery#obtain_confirmation).

<br />

|                                                                                                                                             Parameters                                                                                                                                             ||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sessionState` | `SplitInstallSessionState`: a SplitInstallSessionState with status[SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#REQUIRES_USER_CONFIRMATION) <br /> |
| `starter`      | `IntentSenderForResultStarter`: the intent[IntentSenderForResultStarter](https://developer.android.com/reference/com/google/android/play/core/common/IntentSenderForResultStarter.html) <br />                                                                                     |
| `requestCode`  | `int`: the request code that will be used for[ERROR(/Activity#onActivityResult)](https://developer.android.com/) <br />                                                                                                                                                            |

|                                        Returns                                         ||
|-----------|-----------------------------------------------------------------------------|
| `boolean` | whether the session state is a valid and the dialog has been started <br /> |

|                                                                                           Throws                                                                                            ||
|-----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [IntentSender.SendIntentException](https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html) | if there is an error when starting the dialog for result |

### startConfirmationDialogForResult

```
public abstract boolean startConfirmationDialogForResult (SplitInstallSessionState sessionState, 
                ActivityResultLauncher<IntentSenderRequest> activityResultLauncher)
```

Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html).

This method uses the ActivityResultLauncher provided by Jetpack components to launch the confirmation dialog for result.

<br />

|                                                                                                                                                  Parameters                                                                                                                                                  ||
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sessionState`           | `SplitInstallSessionState`: a SplitInstallSessionState with status[SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#REQUIRES_USER_CONFIRMATION) <br /> |
| `activityResultLauncher` | `ActivityResultLauncher`: an ActivityResultLauncher to launch the confirmation dialog. <br />                                                                                                                                                                                      |

|                                        Returns                                         ||
|-----------|-----------------------------------------------------------------------------|
| `boolean` | whether the session state is a valid and the dialog has been started <br /> |

### startConfirmationDialogForResult

```
public abstract boolean startConfirmationDialogForResult (SplitInstallSessionState sessionState, 
                Activity activity, 
                int requestCode)
```

Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html).

When your app receives a[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)with status[SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#REQUIRES_USER_CONFIRMATION), use this method to obtain consent to download the split via a user confirmation dialog.

This method is run "for result"---analogous to[Activity.startActivityForResult(Intent, int)](https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent,%20int)). The result from the dialog can be handled by the provided`activity`'s[ERROR(/Activity#onActivityResult)](https://developer.android.com/)and is tagged with the provided`requestCode`.

The dialog returns right after user confirmation, with one of the following values:

- [Activity.RESULT_OK](https://developer.android.com/reference/android/app/Activity.html#RESULT_OK)if the user accepted
- [Activity.RESULT_CANCELED](https://developer.android.com/reference/android/app/Activity.html#RESULT_CANCELED)if the user denied

To learn more, read[Obtain user confirmation](https://d.android.com/guide/playcore/dynamic-delivery#obtain_confirmation).

<br />

|                                                                                                                                             Parameters                                                                                                                                             ||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sessionState` | `SplitInstallSessionState`: a SplitInstallSessionState with status[SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#REQUIRES_USER_CONFIRMATION) <br /> |
| `activity`     | `Activity`: the Activity that will be used for[ERROR(/Activity#onActivityResult)](https://developer.android.com/) <br />                                                                                                                                                           |
| `requestCode`  | `int`: the request code that will be used for[ERROR(/Activity#onActivityResult)](https://developer.android.com/) <br />                                                                                                                                                            |

|                                        Returns                                         ||
|-----------|-----------------------------------------------------------------------------|
| `boolean` | whether the session state is a valid and the dialog has been started <br /> |

|                                                                                           Throws                                                                                            ||
|-----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [IntentSender.SendIntentException](https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html) | if there is an error when starting the dialog for result |

### startInstall

```
public abstract Task<Integer> startInstall (SplitInstallRequest request)
```

Initiates a request to download and install split APKs for additional features or language resources.

To learn more, read[Request an on demand module](https://d.android.com/guide/playcore/dynamic-delivery#monitor_requests)or[Download additional language resources](https://d.android.com/guide/playcore/dynamic-delivery#lang_resources).

<br />

|                                                                                                   Parameters                                                                                                   ||
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `request` | `SplitInstallRequest`: the[SplitInstallRequest](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallRequest.html)you built for the install request <br /> |

|                                                                                                                                                                                          Returns                                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`>` | session id, which can be used to subsequently interact with the session after it is created. A session id of 0 indicates that the splits are already installed; in this case no session is generated. <br /> |

### unregisterListener

```
public abstract void unregisterListener (SplitInstallStateUpdatedListener listener)
```

Unregisters a listener you previously registered using[registerListener(SplitInstallStateUpdatedListener)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#registerListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener)).

<br />

|                      Parameters                       ||
|------------|-------------------------------------------|
| `listener` | `SplitInstallStateUpdatedListener` <br /> |