As a newbie, I was wondering if layouts are reusable. For example, say I
have Activities A and B, and they both have the same layout for the screen.
So I create Layout L in the file my_layout.xml, which has a Textfield with
@id+/textfield1 in the layout and it is blank.

In the onCreate() of both Activities A and B, can I have the line
setContentView(R.my_layout)? Will there be any issues when switching from
one Activity to the other?

Will I have issues accessing the Textfield with id textfiel1? If the user
sets the value Activity A and I save it somewhere (say in the Application
object), then when I display Activity B, textfield1 should be blank. Right?

Other than one less layout file, am I really saving any resources by having
one layout file?

Or, is it better practice to create two layout files, one for each
Activity, and to have two unique textfields in these two layouts.

Thanks,

Mark

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

Reply via email to