Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns this element's annotation for the specified type if such an annotation is <em>present</em>, else null.
[Android.Runtime.Register("getAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "GetGetAnnotation_Ljava_lang_Class_Handler:Java.Lang.Reflect.IAnnotatedElementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.annotation.Annotation" })]
public Java.Lang.Object? GetAnnotation(Java.Lang.Class annotationClass);
[<Android.Runtime.Register("getAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", "GetGetAnnotation_Ljava_lang_Class_Handler:Java.Lang.Reflect.IAnnotatedElementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.annotation.Annotation" })>]
abstract member GetAnnotation : Java.Lang.Class -> Java.Lang.Object
the Class object corresponding to the annotation type
this element's annotation for the specified annotation type if present on this element, else null
Returns this element's annotation for the specified type if such an annotation is <em>present</em>, else null.
Added in 1.5.
Java documentation for java.lang.reflect.AnnotatedElement.getAnnotation(java.lang.Class<T>)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in