How to edit xml files within layout directory in android. And how can I use controls (defined in xml file) in my java code.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are using Eclipse, double click on the XML file, it will be opened in the editing pan at the right side. You can edit it in either Graphical Layout or XML by clicking on the tabs below.
Update: You can use the controls (or widgets) defined in XML file in Java code in the following way. Say, you’ve defined an EditText element with
android:id="@+id/textFirstName", you can access this in code like this,