Translations:Android Training/Building a Simple User Interface/15/en

Aus Android Wiki
Version vom 18. Dezember 2015, 02:24 Uhr von FuzzyBot (Diskussion | Beiträge) (FuzzyBot verschob die Seite Translations:Android Training/Eine einfache Benutzeroberfläche erstellen/15/en nach Translations:Android Training/Building a Simple User Interface/15/en, ohne dabei eine Weiterleitung anzulegen: Teil der übersetzba…)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

android:id[Quelltext bearbeiten]

This provides a unique identifier for the view, which you can use to reference the object from your app code, such as to read and manipulate the object (you'll see this in the next lesson). The at sign (@) is required when you're referring to any resource object from XML. It is followed by the resource type (id in this case), a slash, then the resource name (edit_message). The plus sign (+) before the resource type is needed only when you're defining a resource ID for the first time. When you compile the app, the SDK tools use the ID name to create a new resource ID in your project's gen/R.java file that refers to the EditText element. With the resource ID declared once this way, other references to the ID do not need the plus sign. Using the plus sign is necessary only when specifying a new resource ID and not needed for concrete resources such as strings or layouts. See the sidebox for more information about resource objects.