Freigeben über


View.OnInitializeAccessibilityEvent(AccessibilityEvent) Method

Definition

Initializes an AccessibilityEvent with information about this View which is the event source.

[Android.Runtime.Register("onInitializeAccessibilityEvent", "(Landroid/view/accessibility/AccessibilityEvent;)V", "GetOnInitializeAccessibilityEvent_Landroid_view_accessibility_AccessibilityEvent_Handler")]
public virtual void OnInitializeAccessibilityEvent (Android.Views.Accessibility.AccessibilityEvent? e);
[<Android.Runtime.Register("onInitializeAccessibilityEvent", "(Landroid/view/accessibility/AccessibilityEvent;)V", "GetOnInitializeAccessibilityEvent_Landroid_view_accessibility_AccessibilityEvent_Handler")>]
abstract member OnInitializeAccessibilityEvent : Android.Views.Accessibility.AccessibilityEvent -> unit
override this.OnInitializeAccessibilityEvent : Android.Views.Accessibility.AccessibilityEvent -> unit

Parameters

e
AccessibilityEvent

The event to initialize.

Attributes

Remarks

Initializes an AccessibilityEvent with information about this View which is the event source. In other words, the source of an accessibility event is the view whose state change triggered firing the event.

Example: Setting the password property of an event in addition to properties set by the super implementation:

public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
                super.onInitializeAccessibilityEvent(event);
                event.setPassword(true);
            }

If an AccessibilityDelegate has been specified via calling #setAccessibilityDelegate(AccessibilityDelegate) its AccessibilityDelegate#onInitializeAccessibilityEvent(View, AccessibilityEvent) is responsible for handling this call.

<p class="note"><strong>Note:</strong> Always call the super implementation before adding information to the event, in case the default implementation has basic information to add. </p>

Java documentation for android.view.View.onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent).

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.

Applies to

See also