1. Download the #1 Android News App:   EarlyBird - News for Android
    Dismiss Notice

XML ViewFlipper accessing other XMLs directly?

Last Updated:

  1. That Don Guy

    That Don Guy Member

    Is there a way for an XML file to access the contents of other XML files directly?

    That is, I have a ViewFlipper defined in main.xml, and two other layouts defined in other files (page1.xml and page2.xml). Is there a way to put into main.xml something that indicates that the ViewFlipper's two child views are in page1.xml and page2.xml, or do I have to do this in Java (presumably in the app's OnCreate(), with separate addView calls for both page1 and page2)?

    -- Don

  2. JamTheMan

    JamTheMan Well-Known Member

    You can use the <include> tag to re-use layout.xml files inside other layouts.

    Code (Text):
    2. <include
    3.     layout="@layout/other.xml"
    4. />

Share This Page