What was used @ in xml file with parent attribute in style

possible duplicate

Hi friends,

I saw a lot of style files and I see that for some time @sign was used in the parent attribute on the style tab in the XML file, and some without it @, like this

<style name="Theme" parent="android:style/Theme" /> 

this one is found from this style http://code.google.com/p/iosched/source/browse/android/res/values/styles.xml

 <style name="AppTheme.Light" parent="@android:style/Theme.Holo.Light"> 

this one is found from this style http://developer.android.com/resources/samples/HoneycombGallery/res/values/styles.html

Is there any difference from the above statement with / without using @? If so, what's the difference

+4
source share
1 answer

The at (@) character at the beginning of the line indicates that the XML parser should parse and extend the rest of the identifier string and identify it as an identifier resource. A plus sign (+) means that this is a new resource name that needs to be created and added to our resources (in the R.java file). There are a number of other identification resources that are offered by the Android platform. When you refer to the Android Resource Identifier, you do not need a plus sign, but it should add the android package namespace, for example:

 android:id="@android:id/empty" 

Check here for details.

http://developer.android.com/guide/topics/ui/declaring-layout.html

Always skip code without reading a document. In fact, the bad things now I learned about it, which first read, and then implemented

+2
source

Source: https://habr.com/ru/post/1387382/


All Articles