bryan costanich
bryan costanich

Reputation: 1739

Android - Defining Custom Component Layouts in XML

i'm reading the android developer docs on creating custom components and one thing that's unclear, is whether you can define the layout of your component using xml and then reuse that across class libraries. like, say for instance, i want to create a class library called myComponents, and in there i want to have myTehAwesumsWidget or whatever, and i want the layout to be defined in xml, can i include that xml in the referenced class library?

Upvotes: 0

Views: 2793

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007554

If you replace "class library" with "Android library project", everything you describe should work just fine. Here is an Android library project that distributes a custom widget (also wrapped in a dialog and custom preference).

Upvotes: 1

Related Questions