am 9de22952: am ab833be6: Merge "docs: Fix bug with Accessibility Services dev guide" into klp-modular-docs
* commit '9de229527e710a90b03a415a9b752cc6e2a11592': docs: Fix bug with Accessibility Services dev guide
This commit is contained in:
@@ -71,24 +71,30 @@ accessibility service.</p>
|
||||
|
||||
<h3 id="service-declaration">Accessibility service declaration</h3>
|
||||
|
||||
<p>In order to be treated as an accessibility service, your application must include the
|
||||
<p>In order to be treated as an accessibility service, you must include a
|
||||
{@code service} element (rather than the {@code activity} element) within the {@code application}
|
||||
element in its manifest. In addition, within the {@code service} element, you must also include an
|
||||
element in your manifest. In addition, within the {@code service} element, you must also include an
|
||||
accessibility service intent filter. For compatiblity with Android 4.1 and higher, the manifest
|
||||
must also request the {@link android.Manifest.permission#BIND_ACCESSIBILITY_SERVICE} permission
|
||||
as shown in the following sample:</p>
|
||||
|
||||
<pre>
|
||||
<application>
|
||||
<service android:name=".MyAccessibilityService"
|
||||
android:label="@string/accessibility_service_label"
|
||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
|
||||
<intent-filter>
|
||||
<action android:name="android.accessibilityservice.AccessibilityService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />
|
||||
</application>
|
||||
<manifest>
|
||||
...
|
||||
<uses-permission ... />
|
||||
...
|
||||
<application>
|
||||
...
|
||||
<service android:name=".MyAccessibilityService"
|
||||
android:label="@string/accessibility_service_label"
|
||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
|
||||
<intent-filter>
|
||||
<action android:name="android.accessibilityservice.AccessibilityService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />
|
||||
</application>
|
||||
</manifest>
|
||||
</pre>
|
||||
|
||||
<p>These declarations are required for all accessibility services deployed on Android 1.6 (API Level
|
||||
|
||||
Reference in New Issue
Block a user