What is the meaning of an asterisk (*) when accessing Android XML resources?

What is the meaning of this Android code?

What is the difference between * , + and empty:

 @*android:id 

as in android_ics / packages / apps / Settings / res / layout

 <TextView android:id="@*android:id/timeDisplayForeground" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="none" android:textSize="@dimen/crypt_clock_size" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="@color/crypt_keeper_clock_foreground" android:layout_alignLeft="@*android:id/timeDisplayBackground" android:layout_alignTop="@*android:id/timeDisplayBackground" android:layout_marginBottom="6dip" /> 
+4
source share
2 answers

* Allows you to access private resources. Private resources are private for a reason, because their name may change in the future as part of a firmware or skin update.

It is not recommended to use these resources if you are not working in an environment where you know that these resources will not change and will not break your application in the future.

In your example, the system application refers to private resources, in which you most often see this link *.

+4
source

I answered earlier, but may have misunderstood your question. Your project called R.java has a generated file that lists your resources. For example, when you create your browse and add buttons, you will see that some of this information will be automatically loaded into your R.java file. In Java, you access information using these members. However, in XML, you must access them by specifying labels or nodes.

 @android:id refers to the public system member called "id" @id refers to one that you've created @+id says to create one called "id" (and what to set it to) @*android:id refers to a private system member 

Refer to: http://developer.android.com/training/basics/firstapp/building-ui.html

+1
source

All Articles