Android FAQ: How do I look up (find) a widget in my Java code that I’ve defined in an XML layout file?
Solution: When you define your Android widgets in XML and then need to find a widget by its
id, the method you need is named
For example, you’ll use code like this to look up a widget by its
id and create it in your Java code: