On Tue, Aug 24, 2010 at 5:06 PM, Doug Gordon <gordo...@gmail.com> wrote:
> I'm just getting into developing my app, which will have quite a
> number of activities and thus quite a few XML files to lay out the
> screens and define all the views. What I'm just seeing is that if I
> assign the IDs using "@+id/name", I'll have to have a unique name for
> every widget on every screen since all the symbols get defined in one
> big R.java file.
>
> Or can I just generate the definitions once in one of the XML files
> and then reference them in the other layout files? For example, if I
> have a TextView that I'd like to call "surname" in multiple layout
> files, can I declare it one of the files using "@+id/surname" and then
> simply use "@id/surname" in the other files? I assume that as long as
> all the IDs are unique within a layout file, all is OK.

No, you can't declare it that way. However, if you use @+id/surname
multiple times, only one R.id.surname entry goes in R.java.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to