Uncontrolled focus order

Context

UI

Affects

User Experience,Accessibility

Problem

Using directional controls means that there a four directions of navigation up, down, left (previous) and right (next). By default the Android system computes the nearest neighbor ui element and set it appropriatly. In some cases this might not be the desired (unlogical) effect.

Refactorings

Control focus order

Resolves

Accessibility,User Experience

Affects

Solution

Use the XML attributes:

It is also possible to set it at runtime via:

It might be necessary to set the android:focusable attribute first (on elements that do not set it true by default).

Links

Related