Stay organized with collections
Save and categorize content based on your preferences.
MockDialogInterface
open class MockDialogInterface : DialogInterface
A mock android.content.DialogInterface
class. All methods are non-functional and throw java.lang.UnsupportedOperationException
. Override it to provide the operations that you need.
Summary
Public constructors
MockDialogInterface
MockDialogInterface()
Public methods
cancel
open fun cancel(): Unit
Deprecated: Deprecated in Java.
dismiss
open fun dismiss(): Unit
Deprecated: Deprecated in Java.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MockDialogInterface\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nMockDialogInterface\n===================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/test/mock/MockDialogInterface \"View this page in Java\") \n\n```\nopen class MockDialogInterface : DialogInterface\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.test.mock.MockDialogInterface](#) |\n\n*** ** * ** ***\n\n| **This class was deprecated in API level 24.**\n|\n| Use a mocking framework like [Mockito](https://github.com/mockito/mockito). New tests should be written using the [Android Testing Support Library](https://developer.android.com/tools/testing-support-library/index.html).\n\nA mock [android.content.DialogInterface](../../content/DialogInterface.html#) class. All methods are non-functional and throw [java.lang.UnsupportedOperationException](../../../java/lang/UnsupportedOperationException.html#). Override it to provide the operations that you need.\n\nSummary\n-------\n\n| Inherited constants ||\n|---|---|\n| From class [DialogInterface](../../content/DialogInterface.html#) |----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BUTTON1](../../content/DialogInterface.html#BUTTON1:kotlin.Int) \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BUTTON2](../../content/DialogInterface.html#BUTTON2:kotlin.Int) \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BUTTON3](../../content/DialogInterface.html#BUTTON3:kotlin.Int) \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BUTTON_NEGATIVE](../../content/DialogInterface.html#BUTTON_NEGATIVE:kotlin.Int) The identifier for the negative button. \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BUTTON_NEUTRAL](../../content/DialogInterface.html#BUTTON_NEUTRAL:kotlin.Int) The identifier for the neutral button. \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BUTTON_POSITIVE](../../content/DialogInterface.html#BUTTON_POSITIVE:kotlin.Int) The identifier for the positive button. \u003cbr /\u003e | ||\n\n| Public constructors ||\n|----------------------------------------------------------|---|\n| [MockDialogInterface](#MockDialogInterface())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|----------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [cancel](#cancel())`()` \u003cbr /\u003e |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [dismiss](#dismiss())`()` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### MockDialogInterface\n\n```\nMockDialogInterface()\n```\n\nPublic methods\n--------------\n\n### cancel\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun cancel(): Unit\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### dismiss\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun dismiss(): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*"]]