android-a11y-focus-restoration

Preserve and restore Android accessibility focus across navigation and screen changes.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/benoberkfell/claude-plugins --skill android-a11y-focus-restoration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-a11y-focus-restoration
Source: https://github.com/benoberkfell/claude-plugins/tree/main/plugins/android-a11y/skills/android-a11y-focus-restoration
Command: npx skills add https://github.com/benoberkfell/claude-plugins --skill android-a11y-focus-restoration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Maintains consistent accessibility focus across navigation events, configuration changes, and screen transitions in Android apps to prevent focus loss and improve usability for assistive tech users.

Core Features & Use Cases

  • Preserve focus when moving between Fragments or Composables and after back navigation or screen rotation.
  • Restore focus to previously focused item using ViewModel, SavedStateHandle, rememberSaveable, and explicit focus requests.
  • Handle focus restoration across different navigation architectures (Fragment-based and Jetpack Compose) and common UI changes.

Quick Start

Use this skill to restore and preserve the focused accessibility item when navigating back, rotating the device, or changing configuration.

Frequently Asked Questions about android-a11y-focus-restoration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restore accessibility focus after navigating back in Android Jetpack Compose?

To restore accessibility focus in Jetpack Compose after back navigation, use rememberSaveable to persist the focused item state and apply explicit focus requests to re-assign focus when the Composable re-enters the hierarchy.

Why does Android accessibility focus drop after device rotation and how do I preserve it?

Accessibility focus drops after device rotation because the UI is recreated. Preserve focus by storing the focused item identifier in a ViewModel or SavedStateHandle and explicitly requesting focus during the recreated view initialization.

What is the best way to manage focus restoration across Fragment-based navigation in Android?

The best way to manage focus restoration across Fragment-based navigation is to save the focused view state in a shared ViewModel and apply explicit focus requests when the user navigates back to the target Fragment.

Can I use SavedStateHandle to save RecyclerView focus state during screen transitions?

Yes, you can use SavedStateHandle to save RecyclerView focus state by storing the focused item adapter position or unique identifier, then retrieving it to request focus on the exact item after the screen transition.

Does Android Compose navigation support explicit focus requests for accessibility?

Yes, Android Compose navigation supports explicit focus requests by pairing focus state persistence using rememberSaveable with FocusRequester objects to direct assistive technology to the correct UI element after navigation.

When should I use explicit focus requests instead of default view focus in Android?

Use explicit focus requests instead of default view focus when automatic focus recovery fails during complex screen transitions, configuration changes, or back navigation where the previously focused item must reliably regain focus.