Tutorial

Android @IntDef Annotation Example

Android has some helpful annotations in the support library so, in this post, I will show you an example of how to use @IntDef annotation. You can use this annotation (or @StringDef annotation) instead of Enum. Steps 1. Add your constants 2. Add the @IntDef annotation and between ({ }) paranthesis, declare your constants @IntDef({CONSTANT1, CONSTANT2, CONSTANT3}) 3. Add the @Retention […]

, , , , ,