Summer Special Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: vce65

In general, you should send an AccessibilityEvent whenever the content of your custom view changes.

In general, you should send an AccessibilityEvent whenever the content of your custom view changes. For example, if you are implementing a custom slider bar that allows a user to select a numeric value by pressing the left or right arrows, your custom view should emit an event of type TYPE_VIEW_TEXT_CHANGED whenever the slider value changes. Which one of the following sample codes demonstrates the use of the sendAccessibilityEvent() method to report this event.

A.

override fun dispatchPopulateAccessibilityEvent(event: AccessibilityEvent): Boolean {

return super.dispatchPopulateAccessibilityEvent(event).let { completed -> if (text?.isNotEmpty() == true) {

event.text.add(text) true

} else {

completed

}

}

}

B.

override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { return when(keyCode) {

KeyEvent.KEYCODE_DPAD_LEFT -> {

currentValue--

sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED)

true

}

...

}

}

C.

override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { return when(keyCode) {

KeyEvent.KEYCODE_ENTER -> {

currentValue--

sendAccessibilityEvent

(AccessibilityEvent.TYPE_VIEW_CONTEXT_CLICKED)

true

}

...

}

}

Google Associate-Android-Developer Summary

  • Vendor: Google
  • Product: Associate-Android-Developer
  • Update on: Jul 30, 2025
  • Questions: 128
Price: $52.5  $149.99
Buy Now Associate-Android-Developer PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method