- Create a new empty layout file. (Right click on the projekt and select "New" and "Android XML File")
Mark resource as "Layout". Give the file a file name, in my case i use "inventory.xml". - Place a button on the layout. (button01), save the file.
- In the onCreate event, place this code:
---
super.onCreate(savedInstanceState);
setContentView(R.layout.inventory);
//findViewById(R.id.button1).setOnClickListener(xProduct); (example for doing something with the button)
---
After this line of code you are able to access all objects in your own layout file.
Thursday, July 14, 2011
XML layout files
Use of other XML layout files than main.xml
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment