title: ListView: how to access Item's elements programmatically from outside?
body: <p>I have the following situation.</p>
  
  <p>I have a ListView, each item of the ListView is comprised of different widgets (TextViews, ImageViews, etc...) inflated form a Layout in the <code>getView()</code> method of the custom adapter.</p>
  
  <p>Now, I would like to achieve the following:</p>
  
  <p>when a certain event is triggered I want to change the background of a View which is inside the item.</p>
  
  <p>Please how do I do it?</p>
  
  <hr>
  
  <p>This is the the Item Layout:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/cardlayout"
  android:layout_width="320dp"
  android:layout_height="130dp"
  android:background="@android:color/transparent"
  android:orientation="vertical"
  android:paddingBottom="5dp"
  android:paddingRight="5dp"
  android:paddingTop="5dp" &gt;
  
  &lt;FrameLayout
      android:layout_width="320dp"
      android:layout_height="117dp" &gt;
  
      &lt;View
          android:id="@+id/card"
          android:layout_width="320dp"
          android:layout_height="117dp"
          android:background="@drawable/card_selector" /&gt;
  
  &lt;/FrameLayout&gt;  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I need to change the background of <code>card</code></p>
  
  <p>I have tried doing this:</p>
  
  <pre><code>View v=lv.getAdapter().getView(index, null, lv);
  View card =(View)v.findViewById(R.id.card);
  card.setBackgroundResource(R.drawable.pressed_background_card);
  </code></pre>
  
  <p>But no success :-((</p>