Changing and disabling tools

In this document
chevron_rightChanging tool

Changing tool

When ToolManager is being set up, the default Tool is the Pan Tool. To change the tool, use ToolManager.setTool(ToolManager.Tool) API.

For example, to switch to the Text Highlighting tool, do the following:

mToolManager.setTool(mToolManager.createTool(ToolMode.TEXT_HIGHLIGHT, mToolManager.getTool()));

Disabling tools in ToolManager

The default QuickMenu and AnnotationToolbar will show a default set of tools unless you explicitly disable tools. Once a Tool is disabled, ToolManager will never switch to it. Instead, it will switch to the Pan tool. Pan tool cannot be disabled.

Tools can be disabled using the disableToolMode (ToolMode[]) API. For example, the following code removes the Text Highlight tool from the Quick Menu and the Annotation Toolbar, and makes tapping on links not do anything:

// disable LinkAction tool, TextHighlightCreate tool
mToolManager.disableToolMode(new ToolMode[]{