View in multiple XML files

by Vaibhav Gathibandhe » Sat, 13 Sep 2008 19:46:31 GMT

Sponsored Links
 Hello all,

Is there any way I can put a large view in multiple XML files.

For example, If i have a view consist of TableLayout and under it I have 6
table rows. Those table rows consist of text view, buttons etc.
The first 2 rows are static, i.e. I always show them in this activity.
But I do want to select 2-3 table rows from remaining four table rows,
depending upon some conditions.

I see there is a addContentView() method for such conditions. But then I
have to program my table rows rather than using XML.

So, it is possible that I define those 4 table rows in separate XML files
and just grab the ones that I need at runtime and add to TableLayout.

Please let me know if I am not clear enough.

Thanks in advance.


View in multiple XML files

by Romain Guy » Sat, 13 Sep 2008 19:52:14 GMT

 Yes, just put that view in a separate XML file and use the tag
<include layout="@layout/my_table" /> to include it.

On Sat, Sep 13, 2008 at 11:37 AM, Vaibhav Gathibandhe

Romain Guy


Sponsored Links

Other Threads

1. How can I create TextAppearanceSpan which looks like an anchor

look at spannable class and "styling resources" in developer site.

Also look at clickablescan and some other spans which might help you to
achieve this


2. Solved WTA : ngapus account di hero

Makasi atas bantuan semuanya, problem solved

Powered by Telkomsel BlackBerry

"Indonesian Android Community [id-android]" 

3. Deciding which method to call when intent is received

4. Move buttons within Layout

5. Deciding which method to call when intent is received

6. How to input cursor position on tap?

7. Activity calling not from another activity