The question mark looks new to me

it

<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/separator" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" style="?android:attr/listSeparatorTextViewStyle" /> 

or

  <item name="android:textColor">?textColorSecondary</item> 

Sometimes I see a question mark in content xml node like this and I don’t know what it is for without documentation?

+4
source share
1 answer

? refers to a resource in the current topic, it is described in the Developer's Guide Access to resources :

The style attribute resource allows you to reference the attribute value in the current topic. The link to the style attribute allows you to customize the appearance of the user interface elements, putting them in accordance with the standard options provided by the current theme, instead of entering a hard-coded value. The reference to the style attribute basically says: "Use the style defined by this attribute in the current topic."

To refer to a style attribute, the syntax of the name is almost identical to the normal format of the resource, but use the question mark (?) Instead of the at (@) character, and part of the resource type is optional. For instance:

 ?[<package_name>:][<resource_type>/]<resource_name> 
+3
source

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


All Articles