Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fragment] Add lint warning for calling setOnCancelListener and setOnDismissListener in onCreateDialog() #171

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove trailing whitespaces
  • Loading branch information
tatocaster committed May 5, 2021
commit 1d77d071fea3ffd08f3ff88fe0388f616394fa1c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 53,7 @@ class OnCreateDialogIncorrectCallbackDetector : Detector(), SourceCodeScanner {
explanation = """When using a `DialogFragment`, the `setOnCancelListener` and \
`setOnDismissListener` callback functions within the `onCreateDialog` function \
__must not be used__ because the `DialogFragment` owns these callbacks. \
Instead the respective `onCancel` and `onDismiss` functions can be used to \
Instead the respective `onCancel` and `onDismiss` functions can be used to \
achieve the desired effect.""",
category = Category.CORRECTNESS,
severity = Severity.WARNING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 68,7 @@ class OnCreateDialogIncorrectCallbackDetectorTest : LintDetectorTest() {
override fun onCancel(dialog: DialogInterface) {
super.onCancel(dialog)
}

override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog)
}
Expand Down