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. C/C++ clients to make HTTP requests via Android ..??

Hi Moderator,
                   I am trying to port my C/C++ code in anroid & but
got stuck. My query is :  "Does Android have support for libcurl (or
an equivalent) that would allow C++ clients to make HTTP requests via
Android?"  WebKit appears to have at least a partial implementation of
some CURL APIs, but they don't appear to be availble for use by third-
party code.



2. Using the dev phone without a wireless carrier

Is it possible to use the dev phone without having a service contract
with any mobile carrier? I want to use the dev phone in a class to
teach app development using all the other features of the device
except for telephony. Is that possible?

Also, does anyone know of institutions that have classes that teach
app development using the Android platform?


3. Alarm manager on boot only runs once?

4. Stuck at starting Intent ??

5. Package Problems following Notepad Tutorial in Eclipse for Android 1.5_r3: not Included

6. Must have missed something...1.5->1.6

7. build path error (solved)