diff options
| author | 2016-07-07 15:57:01 +0000 | |
|---|---|---|
| committer | 2016-07-07 15:57:03 +0000 | |
| commit | 13ce5dca58e27800253f620b527e400c2bc4b75e (patch) | |
| tree | 7570d4f089db9711a28881e09ade4896e5ebb2ed | |
| parent | cdfe5e4f554fe7269c1234a838dbc9ea8ce63ab1 (diff) | |
| parent | 14609e3c56ba72521dbe2bd5016f13216621c102 (diff) | |
Merge "Docs: Fixed wrong return type of a method" into mnc-io-docs
| -rw-r--r-- | docs/html/guide/topics/ui/accessibility/apps.jd | 8 |
1 files 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 47e2eff54285..c5fe1257e66e 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.</p> <pre> @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; } </pre> |