I have a bunch of View in <merge> and I have included <merge> in RelativeLayout . I try to reference the identifiers of the included View to act as anchors for my other View s, but Eclipse complains that the identifiers are not resolved. I found a workaround using @+id , not @id , when I refer to them first, and not when I actually define the objects that they refer to. I already defined two ID in Style and in the included <merge> , where they are declared, so it feels a little inefficient if I repeat the definition of the identifier.
Is this the right way to do this? I assume this is bad because the β+β is another initialization. My current hypothesis is that you should use @+id when you first use the identifier, and not when initializing the object that will represent the identifier, is a bit like C/C++ and how they require at least a function prototype in lines up to the actual code that uses this function.
One more question: when you use the Eclipse GUI builder, I noticed that they always use @+id , not @id . Is this acceptable because it seems to me ineffective; itβs as if the application would spend more time determining if the ID was declared in R.id
cesar source share