Stay organized with collections
Save and categorize content based on your preferences.
SavedDatasetsInfoCallback
public
interface
SavedDatasetsInfoCallback
android.service.autofill.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 |
int |
ERROR_NEEDS_USER_ACTION
The result cannot be computed until the user takes some action, such as setting up their
account.
|
int |
ERROR_OTHER
The result could not be computed for any other reason.
|
int |
ERROR_UNSUPPORTED
The service does not support this request.
|
Public methods |
abstract
void
|
onError(int error)
Respond to the request with an error.
|
abstract
void
|
onSuccess(Set<SavedDatasetsInfo> results)
Successfully respond to the request with the info on each type of saved datasets.
|
Constants
ERROR_NEEDS_USER_ACTION
public static final int ERROR_NEEDS_USER_ACTION
The result cannot be computed until the user takes some action, such as setting up their
account.
Constant Value:
2
(0x00000002)
ERROR_OTHER
public static final int ERROR_OTHER
The result could not be computed for any other reason.
Constant Value:
0
(0x00000000)
ERROR_UNSUPPORTED
public static final int ERROR_UNSUPPORTED
The service does not support this request.
Constant Value:
1
(0x00000001)
Public methods
onError
public abstract void onError (int error)
Respond to the request with an error. System settings may display a suitable notice to the
user.
onSuccess
public abstract void onSuccess (Set<SavedDatasetsInfo> results)
Successfully respond to the request with the info on each type of saved datasets.
Parameters |
results |
Set : This value cannot be null . |
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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nSavedDatasetsInfoCallback\n=========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/service/autofill/SavedDatasetsInfoCallback \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nSavedDatasetsInfoCallback\n`\n\n\n`\n\n\n`\n\n|----------------------------------------------------|\n| android.service.autofill.SavedDatasetsInfoCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nHandles the response to\n[AutofillService.onSavedDatasetsInfoRequest(SavedDatasetsInfoCallback)](/reference/android/service/autofill/AutofillService#onSavedDatasetsInfoRequest(android.service.autofill.SavedDatasetsInfoCallback)).\n\n\nUse [onSuccess(java.util.Set)](/reference/android/service/autofill/SavedDatasetsInfoCallback#onSuccess(java.util.Set\u003candroid.service.autofill.SavedDatasetsInfo\u003e)) to return the computed info about the datasets the user saved to this\nservice. If there was an error querying the info, or if the service is unable to do so at this\ntime (for example, if the user isn't logged in), call [onError(int)](/reference/android/service/autofill/SavedDatasetsInfoCallback#onError(int)).\n\n\nThis callback can be used only once.\n\nSummary\n-------\n\n| ### Constants ||\n|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [ERROR_NEEDS_USER_ACTION](/reference/android/service/autofill/SavedDatasetsInfoCallback#ERROR_NEEDS_USER_ACTION) The result cannot be computed until the user takes some action, such as setting up their account. |\n| `int` | [ERROR_OTHER](/reference/android/service/autofill/SavedDatasetsInfoCallback#ERROR_OTHER) The result could not be computed for any other reason. |\n| `int` | [ERROR_UNSUPPORTED](/reference/android/service/autofill/SavedDatasetsInfoCallback#ERROR_UNSUPPORTED) The service does not support this request. |\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onError](/reference/android/service/autofill/SavedDatasetsInfoCallback#onError(int))`(int error) ` Respond to the request with an error. |\n| ` abstract void` | ` `[onSuccess](/reference/android/service/autofill/SavedDatasetsInfoCallback#onSuccess(java.util.Set\u003candroid.service.autofill.SavedDatasetsInfo\u003e))`(`[Set](/reference/java/util/Set)`\u003c`[SavedDatasetsInfo](/reference/android/service/autofill/SavedDatasetsInfo)`\u003e results) ` 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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_NEEDS_USER_ACTION\n```\n\nThe result cannot be computed until the user takes some action, such as setting up their\naccount.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\n### ERROR_OTHER\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_OTHER\n```\n\nThe result could not be computed for any other reason.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### ERROR_UNSUPPORTED\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int ERROR_UNSUPPORTED\n```\n\nThe service does not support this request.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onError (int error)\n```\n\nRespond to the request with an error. System settings may display a suitable notice to the\nuser.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `error` | `int`: Value is [ERROR_OTHER](/reference/android/service/autofill/SavedDatasetsInfoCallback#ERROR_OTHER), [ERROR_UNSUPPORTED](/reference/android/service/autofill/SavedDatasetsInfoCallback#ERROR_UNSUPPORTED), or [ERROR_NEEDS_USER_ACTION](/reference/android/service/autofill/SavedDatasetsInfoCallback#ERROR_NEEDS_USER_ACTION) \u003cbr /\u003e |\n\n### onSuccess\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onSuccess (Set\u003cSavedDatasetsInfo\u003e results)\n```\n\nSuccessfully respond to the request with the info on each type of saved datasets.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|--------------------------------------------|\n| `results` | `Set`: This value cannot be `null`. \u003cbr /\u003e |"]]