From 14609e3c56ba72521dbe2bd5016f13216621c102 Mon Sep 17 00:00:00 2001 From: Hemal Patel Date: Thu, 16 Jun 2016 19:26:26 -0700 Subject: [PATCH] Docs: Fixed wrong return type of a method The code sample within the Populating accessibility events section now uses a boolean return type for the dispatchPopulateAccessibilityEvent() method. Bug: 28001824 Change-Id: Ie29c3588fc0930b3f3646c6f6ce61c60842c2232 --- docs/html/guide/topics/ui/accessibility/apps.jd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/html/guide/topics/ui/accessibility/apps.jd b/docs/html/guide/topics/ui/accessibility/apps.jd index 47e2eff542859..c5fe1257e66e1 100644 --- a/docs/html/guide/topics/ui/accessibility/apps.jd +++ b/docs/html/guide/topics/ui/accessibility/apps.jd @@ -454,18 +454,20 @@ following example code demonstrates a basic implementation of this method.

 @Override
-public void dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
-    super.dispatchPopulateAccessibilityEvent(event);
+public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
     // Call the super implementation to populate its text to the event, which
     // calls onPopulateAccessibilityEvent() on API Level 14 and up.
-
+    boolean completed = super.dispatchPopulateAccessibilityEvent(event);
+    
     // In case this is running on a API revision earlier that 14, check
     // the text content of the event and add an appropriate text
     // description for this custom view:
     CharSequence text = getText();
     if (!TextUtils.isEmpty(text)) {
         event.getText().add(text);
+        return true;
     }
+    return completed;
 }