Claude Code Android Java Skill for Fragment ViewBinding
Review a Java Fragment's generated binding, view-scoped observation and behavior when its view is recreated.
中文Install in Claude Code
Use an Android module with XML layouts, Java and ViewBinding enabled. Use the project's existing Espresso setup if you add a device test.
- Get the complete `skills/android-java` directory from the pinned revision.
- Copy it into the target project's `.claude/skills/` and confirm `.claude/skills/android-java/SKILL.md`. Start Claude Code at the project root and describe a task matching the skill's purpose.
Example task
In a bookmarks Fragment, leave the screen and navigate back. Design a check that the recreated list renders the same bookmarks from its ViewModel.What to check
The verification covers the old binding being cleared and the recreated view receiving the expected list. Report any lifecycle paths the test cannot observe.
Original SKILL.md on GitHub · Updated
Frequently asked question
Why clear the binding in onDestroyView?
The binding references the Fragment's current view hierarchy. The Fragment itself can survive the destruction of that hierarchy.