Question: I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:

```
<item android:id="@+id/camera"
    android:title="Camera"
    android:icon="?attr/menuIconCamera"
    android:showAsAction="ifRoom" />

```

The `?attr` is throwing me for a loop. Can someone please explain what this is doing? How is this related to a drawable? I can't seem to find any good information on Google. Also is there a listing or gallery of attributes we can use for icons instead of just `menuIconCamera`?

Thanks

Edit:
I did some more looking around and found that attrs.xml looks like this:

```
<resources>
<declare-styleable name="AppTheme">
    <attr name="listDragShadowBackground" format="reference" />
    <attr name="menuIconCamera" format="reference" />
    <attr name="menuIconToggle" format="reference" />
    <attr name="menuIconShare" format="reference" />
</declare-styleable>

```

Unfortunately that just makes it even more confusing for me. What is this doing?

Answer: 
The `?attr:` syntax is used for accessing attributes of current theme. See [referencing style attributes](http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes).
I know this post is very old, but I feel the following explanation will help beginners understand it easily.

So in layman's terms,

`someAttribute="?attr/attributeName"` means -

> 
> set the value of **someAttribute** to whatever is the value of **attributeName** in current theme
> 
> 
> 

A common example occurs in styling a Toolbar

```
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/primary_color</item>
       //some more stuff here
</style>
<!-- custom toolbar style -->
<style name="myToolbar" parent="Widget.AppCompat.Toolbar">
      <item name="android:background">?attr/colorPrimary</item>
     //some code here
</style>

```

Here value of `android:background` will be set to `@color/primary_color` because `?attr/colorPrimary` refers to `@color/primary_color` in the current theme (AppTheme)