Merge \"Docs: Fixed wrong return type of a method\" into mnc-io-docs
am: 13ce5dca58
Change-Id: Iece5dfd7fcf3bd0113e3e5fb84a0eac7ad361ae0
This commit is contained in:
@@ -454,10 +454,10 @@ following example code demonstrates a basic implementation of this method.</p>
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
@Override
|
@Override
|
||||||
public void dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
|
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
|
||||||
super.dispatchPopulateAccessibilityEvent(event);
|
|
||||||
// Call the super implementation to populate its text to the event, which
|
// Call the super implementation to populate its text to the event, which
|
||||||
// calls onPopulateAccessibilityEvent() on API Level 14 and up.
|
// 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
|
// In case this is running on a API revision earlier that 14, check
|
||||||
// the text content of the event and add an appropriate text
|
// the text content of the event and add an appropriate text
|
||||||
@@ -465,7 +465,9 @@ public void dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
|
|||||||
CharSequence text = getText();
|
CharSequence text = getText();
|
||||||
if (!TextUtils.isEmpty(text)) {
|
if (!TextUtils.isEmpty(text)) {
|
||||||
event.getText().add(text);
|
event.getText().add(text);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return completed;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user