• android
    @Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.FIELD, AnnotationTarget.CONSTRUCTOR])
    annotation ReplaceWith

Specifies a code fragment that can be used to suggest a replacement for a method in conjunction with the ReplaceWith lint check.

The expression parameter specified the replacement expression, which is interpreted in the context of the symbol being used and can reference members of the enclosing classes, etc.

For method calls, the replacement expression may contain parameter names of the method being replaced, which will be substituted with actual arguments used in the call being replaced:

@ReplaceWith(expression = "event.getActionType(slot)")
static int getActionType(AccessibilityEvent event, int slot) { ... }

Summary

Public constructors

ReplaceWith(expression: String, vararg imports: String)
android

Public properties

String
android
Array<String>
android

Public constructors

ReplaceWith

ReplaceWith(expression: String, vararg imports: String = [])

Public properties

expression

val expressionString

imports

val importsArray<String>