Hi everyone, How can I validate an input for a fun...
# android
s
Hi everyone, How can I validate an input for a function with lint check? For instance if a function should accept only integers >= 0 how can I put a lint check in the parameter?
z
try @IntRange annotation
s
error This annotation is not applicable to target 'type usage'
Copy code
fun round(value: Double, @IntRange(from = 0, to = 10) places: Int = 0): Double {
}
now it worked! cool
thanks Zan
z
anytime