API Demo - Text-to-Speech - How to Change the "Again" Button to Something Else
Java Newbie here. Interested in learning about programming for Android. I'm going through the samples and tutorials on developer.android.com. Using Eclipse and Android SDK for developing. I was checking out the APIDemos and noticed that when compiling the TextToSpeechActivity file, and run it in my phone/emulator, I am able to click on the "Again" button and have it read aloud the text in the TextToSpeechActivit开发者_Go百科y file. What I'd like to know is this.... I cannot figure out where this button is coming from, how it is getting labeled with the word "Again" on it and how it knows to be placed in that exact spot on the phone/emulator screen. Is the button being "built" by Java or is it an actual file located someplace else? I've looked through the various folders in the APIDemos project, but have not been able to locate a graphic that looks like the one showing on the phone/emulator. One last thing, when rolling over the button on the phone/emulator, the button turns from grey to orange. Any help with how this button is created, and how it knows where to be placed on the page would be appreciated.
Without looking at it in detail, I think you should probably be looking for an XML file. My understanding is that layout/components are often declared in XML files in an android project.
精彩评论