Skip to content

Scaffold Fragment

Generate a Fragment class with boilerplate code and an optional XML layout file.

ParameterTypeRequiredDefaultDescription
projectDirstringYesAbsolute path to the Android project root
fragmentNamestringYesFragment class name (e.g., ProfileFragment)
packageNamestringYesPackage name
modulestringNoappModule name
layoutbooleanNotrueGenerate a corresponding XML layout file

Create a ProfileFragment in my project

Scaffold a HomeFragment with layout