Stay organized with collections
Save and categorize content based on your preferences.
SavedDatasetsInfoCallback
interface SavedDatasetsInfoCallback
Handles the response to AutofillService.onSavedDatasetsInfoRequest(SavedDatasetsInfoCallback)
.
Use onSuccess(java.util.Set)
to return the computed info about the datasets the user saved to this service. If there was an error querying the info, or if the service is unable to do so at this time (for example, if the user isn't logged in), call onError(int)
.
This callback can be used only once.
Summary
Constants |
static Int |
The result cannot be computed until the user takes some action, such as setting up their account.
|
static Int |
The result could not be computed for any other reason.
|
static Int |
The service does not support this request.
|
Public methods |
abstract Unit |
Respond to the request with an error.
|
abstract Unit |
Successfully respond to the request with the info on each type of saved datasets.
|
Constants
ERROR_NEEDS_USER_ACTION
static val ERROR_NEEDS_USER_ACTION: Int
The result cannot be computed until the user takes some action, such as setting up their account.
Value: 2
ERROR_OTHER
static val ERROR_OTHER: Int
The result could not be computed for any other reason.
Value: 0
ERROR_UNSUPPORTED
static val ERROR_UNSUPPORTED: Int
The service does not support this request.
Value: 1
Public methods
onError
abstract fun onError(error: Int): Unit
Respond to the request with an error. System settings may display a suitable notice to the user.
onSuccess
abstract fun onSuccess(results: MutableSet<SavedDatasetsInfo!>): Unit
Successfully respond to the request with the info on each type of saved datasets.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# SavedDatasetsInfoCallback\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSavedDatasetsInfoCallback\n=========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/autofill/SavedDatasetsInfoCallback \"View this page in Java\") \n\n```\ninterface SavedDatasetsInfoCallback\n```\n\n|---------------------------------------------------------|\n| [android.service.autofill.SavedDatasetsInfoCallback](#) |\n\nHandles the response to [AutofillService.onSavedDatasetsInfoRequest(SavedDatasetsInfoCallback)](/reference/kotlin/android/service/autofill/AutofillService#onSavedDatasetsInfoRequest(android.service.autofill.SavedDatasetsInfoCallback)).\n\nUse [onSuccess(java.util.Set)](#onSuccess(kotlin.collections.MutableSet)) to return the computed info about the datasets the user saved to this service. If there was an error querying the info, or if the service is unable to do so at this time (for example, if the user isn't logged in), call [onError(int)](#onError(kotlin.Int)).\n\nThis callback can be used only once.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_NEEDS_USER_ACTION](#ERROR_NEEDS_USER_ACTION:kotlin.Int) The result cannot be computed until the user takes some action, such as setting up their account. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_OTHER](#ERROR_OTHER:kotlin.Int) The result could not be computed for any other reason. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_UNSUPPORTED](#ERROR_UNSUPPORTED:kotlin.Int) The service does not support this request. |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(kotlin.Int))`(`error:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Respond to the request with an error. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSuccess](#onSuccess(kotlin.collections.MutableSet))`(`results:` `[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\u003c[SavedDatasetsInfo](/reference/kotlin/android/service/autofill/SavedDatasetsInfo)!\u003e`)` Successfully respond to the request with the info on each type of saved datasets. |\n\nConstants\n---------\n\n### ERROR_NEEDS_USER_ACTION\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_NEEDS_USER_ACTION: Int\n```\n\nThe result cannot be computed until the user takes some action, such as setting up their account. \n\n Value: 2\n\n### ERROR_OTHER\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_OTHER: Int\n```\n\nThe result could not be computed for any other reason. \n\n Value: 0\n\n### ERROR_UNSUPPORTED\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_UNSUPPORTED: Int\n```\n\nThe service does not support this request. \n\n Value: 1\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onError(error: Int): Unit\n```\n\nRespond to the request with an error. System settings may display a suitable notice to the user.\n\n| Parameters ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `error` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.service.autofill.SavedDatasetsInfoCallback#ERROR_OTHER](#ERROR_OTHER:kotlin.Int), [android.service.autofill.SavedDatasetsInfoCallback#ERROR_UNSUPPORTED](#ERROR_UNSUPPORTED:kotlin.Int), or [android.service.autofill.SavedDatasetsInfoCallback#ERROR_NEEDS_USER_ACTION](#ERROR_NEEDS_USER_ACTION:kotlin.Int) |\n\n### onSuccess\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onSuccess(results: MutableSet\u003cSavedDatasetsInfo!\u003e): Unit\n```\n\nSuccessfully respond to the request with the info on each type of saved datasets.\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `results` | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\\\u003c[SavedDatasetsInfo](/reference/kotlin/android/service/autofill/SavedDatasetsInfo)!\\\u003e: This value cannot be `null`. |"]]