AccessibilityManager

public final class AccessibilityManager 
extends Object 

java.lang.Object
   ↳ android.view.accessibility.AccessibilityManager


System level service that serves as an event dispatch for AccessibilityEvents, and provides facilities for querying the accessibility state of the system. Accessibility events are generated when something notable happens in the user interface, for example an Activity starts, the focus or selection of a Viewchanges etc. Parties interested in handling accessibility events implement and register an accessibility service which extends AccessibilityService.

To obtain a handle to the accessibility manager do the following:

AccessibilityManager accessibilityManager =        (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);

See also:

  • AccessibilityEvent
  • AccessibilityNodeInfo
  • AccessibilityService
  • getSystemService(Class)
  • ACCESSIBILITY_SERVICE

Summary


Nested classes

interface AccessibilityManager.AccessibilityStateChangeListener

Listener for the system accessibility state. 

interface AccessibilityManager.TouchExplorationStateChangeListener

Listener for the system touch exploration state. 

Public methods

boolean addAccessibilityStateChangeListener(AccessibilityManager.AccessibilityStateChangeListenerlistener)

Registers an AccessibilityManager.AccessibilityStateChangeListener for changes in the global accessibility state of the system.

boolean addTouchExplorationStateChangeListener(AccessibilityManager.TouchExplorationStateChangeListenerlistener)

Registers a AccessibilityManager.TouchExplorationStateChangeListener for changes in the global touch exploration state of the system.

List getAccessibilityServiceList()

This method was deprecated in API level 14. Use getInstalledAccessibilityServiceList()

List getEnabledAccessibilityServiceList(int feedbackTypeFlags)

Returns the AccessibilityServiceInfos of the enabled accessibility services for a given feedback type.

List getInstalledAccessibilityServiceList()

Returns the AccessibilityServiceInfos of the installed accessibility services.

void interrupt()

Requests feedback interruption from all accessibility services.

boolean isEnabled()

Returns if the accessibility in the system is enabled.

boolean isTouchExplorationEnabled()

Returns if the touch exploration in the system is enabled.

boolean removeAccessibilityStateChangeListener(AccessibilityManager.AccessibilityStateChangeListenerlistener)

Unregisters an AccessibilityManager.AccessibilityStateChangeListener.

boolean removeTouchExplorationStateChangeListener(AccessibilityManager.TouchExplorationStateChangeListenerlistener)

Unregisters a AccessibilityManager.TouchExplorationStateChangeListener.

void sendAccessibilityEvent(AccessibilityEvent event)

Sends an AccessibilityEvent.

Inherited methods

From class java.lang.Object

Public methods


addAccessibilityStateChangeListener

Added in  API level 14
boolean addAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)

Registers an AccessibilityManager.AccessibilityStateChangeListener for changes in the global accessibility state of the system.

Parameters
listener AccessibilityManager.AccessibilityStateChangeListener: The listener.
Returns
boolean True if successfully registered.

addTouchExplorationStateChangeListener

Added in  API level 19
boolean addTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)

Registers a AccessibilityManager.TouchExplorationStateChangeListener for changes in the global touch exploration state of the system.

Parameters
listener AccessibilityManager.TouchExplorationStateChangeListener: The listener.
Returns
boolean True if successfully registered.

getAccessibilityServiceList

Added in  API level 4
List getAccessibilityServiceList ()

This method was deprecated in API level 14.
Use getInstalledAccessibilityServiceList()

Returns the ServiceInfos of the installed accessibility services.

Returns
List An unmodifiable list with ServiceInfos.

getEnabledAccessibilityServiceList

Added in  API level 14
List getEnabledAccessibilityServiceList (int feedbackTypeFlags)

Returns the AccessibilityServiceInfos of the enabled accessibility services for a given feedback type.

Parameters
feedbackTypeFlags int: The feedback type flags.
Returns
List An unmodifiable list with AccessibilityServiceInfos.

See also:

  • FEEDBACK_AUDIBLE
  • FEEDBACK_GENERIC
  • FEEDBACK_HAPTIC
  • FEEDBACK_SPOKEN
  • FEEDBACK_VISUAL
  • FEEDBACK_BRAILLE

getInstalledAccessibilityServiceList

Added in  API level 14
List getInstalledAccessibilityServiceList ()

Returns the AccessibilityServiceInfos of the installed accessibility services.

Returns
List An unmodifiable list with AccessibilityServiceInfos.

interrupt

Added in  API level 4
void interrupt ()

Requests feedback interruption from all accessibility services.

isEnabled

Added in  API level 4
boolean isEnabled ()

Returns if the accessibility in the system is enabled.

Returns
boolean True if accessibility is enabled, false otherwise.

isTouchExplorationEnabled

Added in  API level 14
boolean isTouchExplorationEnabled ()

Returns if the touch exploration in the system is enabled.

Returns
boolean True if touch exploration is enabled, false otherwise.

removeAccessibilityStateChangeListener

Added in  API level 14
boolean removeAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)

Unregisters an AccessibilityManager.AccessibilityStateChangeListener.

Parameters
listener AccessibilityManager.AccessibilityStateChangeListener: The listener.
Returns
boolean True if successfully unregistered.

removeTouchExplorationStateChangeListener

Added in  API level 19
boolean removeTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)

Unregisters a AccessibilityManager.TouchExplorationStateChangeListener.

Parameters
listener AccessibilityManager.TouchExplorationStateChangeListener: The listener.
Returns
boolean True if successfully unregistered.

sendAccessibilityEvent

Added in  API level 4
void sendAccessibilityEvent (AccessibilityEvent event)

Sends an AccessibilityEvent.

Parameters
event AccessibilityEvent: The event to send.
Throws
IllegalStateException if accessibility is not enabled. Note: The preferred mechanism for sending custom accessibility events is through callingrequestSendAccessibilityEvent(View, AccessibilityEvent) instead of this method to allow predecessors to augment/filter events sent by their descendants.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android Eclipse JNI 调用 .so文件加载
  2. [Android L]关于Android L的Service启动
  3. android 编译源码 错误解决2
  4. Android 签名类型
  5. Google Maps Android API V2 版本更新导
  6. Android ListView优化
  7. android ui 布局性能优化
  8. Android 客户端发送邮件(JMail方式)
  9. Android打开摄像头拍照,并显示出来
  10. 详解Android中的Activity生命周期