Change view background color at some point
<p>I have a <code>LinearLayout</code>: </p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="wrap_content"
    style="@style/activated_item"/&gt;
</code></pre>

<p>with style/activated_item:</p>

<pre><code>&lt;style name="activated_item" parent="android:Theme.Holo"&gt;
        &lt;item name="android:background"&gt;@drawable/item_light_list&lt;/item&gt;
    &lt;/style&gt;
</code></pre>

<p>where drawable/items_light_list: </p>

<pre><code>    &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"
        android:exitFadeDuration="@android:integer/config_mediumAnimTime"&gt;
         &lt;item android:state_activated="true" android:drawable="@drawable/list_activated_holo"&gt;&lt;/item&gt;
&lt;item android:state_selected="true" android:drawable="@drawable/list_selected_holo_light"&gt;&lt;/item&gt;
        &lt;item android:drawable="@drawable/list_selected_holo_light"&gt;&lt;/item&gt; &lt;!-- If I would remove this line the item will be selected after a long click --&gt;
    &lt;/selector&gt;
</code></pre>

<p>The mentioned <code>LinearLayout</code> is used for inflating in 'view' to be used as an item(s) in <code>ListFragment</code>. I need the <code>android:background</code> value to be changed after a longpress on the item. I tried to do:</p>

<pre><code>public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view,
                    int position, long id) {
                view.setSelected(true);
return true;
</code></pre>

<p>But this didn't work.</p>

<p>Please advice what shall I do and how to change my <code>drawable resourse</code> in order to set a different <code>background color</code> after a <code>longclick</code>. </p>

<p>EDIT: </p>

<p>If I remove <code>&lt;item android:drawable="@drawable/list_selected_holo_light"&gt;&lt;/item&gt;</code> everything is working, but this is not a  workaround for me.</p>
