Stay organized with collections
Save and categorize content based on your preferences.
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-03-13 UTC.
[null,null,["Last updated 2025-03-13 UTC."],[],[],null,["# SdkSandboxClientImportanceListener\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [Ad Services Extensions 14](/sdkExtensions) \n\nSdkSandboxClientImportanceListener\n==================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/app/sdksandbox/sdkprovider/SdkSandboxClientImportanceListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nSdkSandboxClientImportanceListener\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------------------------------|\n| android.app.sdksandbox.sdkprovider.SdkSandboxClientImportanceListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nUsed to notify the SDK about changes in the client's [ActivityManager.RunningAppProcessInfo.importance](/reference/android/app/ActivityManager.RunningAppProcessInfo#importance).\n\nWhen an SDK wants to get notified about changes in client's importance, it should register an\nimplementation of this interface by calling [SdkSandboxController.registerSdkSandboxClientImportanceListener(java.util.concurrent.Executor, android.app.sdksandbox.sdkprovider.SdkSandboxClientImportanceListener)](/reference/android/app/sdksandbox/sdkprovider/SdkSandboxController#registerSdkSandboxClientImportanceListener(java.util.concurrent.Executor,%20android.app.sdksandbox.sdkprovider.SdkSandboxClientImportanceListener)).\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onForegroundImportanceChanged](/reference/android/app/sdksandbox/sdkprovider/SdkSandboxClientImportanceListener#onForegroundImportanceChanged(boolean))`(boolean isForeground) ` Invoked every time the client transitions from a value \\\u003c= [ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND](/reference/android/app/ActivityManager.RunningAppProcessInfo#IMPORTANCE_FOREGROUND) to a higher value or vice versa |\n\nPublic methods\n--------------\n\n### onForegroundImportanceChanged\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [Ad Services Extensions 14](/sdkExtensions) \n\n```\npublic abstract void onForegroundImportanceChanged (boolean isForeground)\n```\n\nInvoked every time the client transitions from a value \\\u003c= [ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND](/reference/android/app/ActivityManager.RunningAppProcessInfo#IMPORTANCE_FOREGROUND) to a higher value or\nvice versa\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `isForeground` | `boolean`: true when the client transitions to [ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND](/reference/android/app/ActivityManager.RunningAppProcessInfo#IMPORTANCE_FOREGROUND) or lower and false when it is the other way round. \u003cbr /\u003e |"]]