Search code examples
androidmouseandroid-4.0-ice-cream-sandwichtouchscreenandroid-4.2-jelly-bean

Android 4.x: detect mouse or touchscreen mode


There is an API to detect if Android 4.x (ICS or JB) is in touchscreen or mouse mode. Android can actually go from one mode to the other: if you are in mouse mode (a cursor is displayed) and you do a touchscreen press, the mouse will disappear. In an apk application, I would like to query the state of mouse vs. touchscreen. This feature is only for > 4.0. Does anyone know this API?


Solution

  • As suggested by nandeesh in the comment section, "isintouchmode" is the answer to this question.