title: background image of a row in a listview
body: <p>I have a listview that displays an image and a text from internet.
  My intention is that this image, in addition to showing a imageview, is the background image of listview row.
  This works but with problems.</p>
  
  <p>In the listview adapter I have for the imageview:</p>
  
  <pre><code>imageLoader.DisplayImage (song.get (principal.KEY_PICTURE) my_imageView);
  </code></pre>
  
  <p>and to use the image in the LinearLayout:</p>
  
  <pre><code>imageLoader.DisplayImageLinear (song.get (principal.KEY_PICTURE) my_linearLayout);
  </code></pre>
  
  <p>This calls the following method:</p>
  
  <pre><code>public void DisplayImageLinear (String url, LinearLayout linearbck)
  {
  Bitmap bitmap = memoryCache.get (url);
  Drawable d = new BitmapDrawable (bitmap);
  if (bitmap! = null) {
  linearbck (d);
  }
  else
  { linearbck.setBackgroundResource (R.drawable.list_selector); }
  }
  </code></pre>
  
  <p>My problem is that the background images of the rows of the listview are only visible when the listview slip and rows out of the screen and re-enter ...</p>
  
  <p>I hope I'm explaining correctly .. here a picture explaining the problem</p>
  
  <p><img src="https://i.stack.imgur.com/FTpc2.jpg" alt="enter image description here"></p>
  
  <p>I tried to use linearbck.invalidate (), but without success</p>
  
  <p>I sincerely appreciate any help</p>
  
  <p>thanks</p>
  
  <p>Best regards</p>
  
  <p>EDIT:</p>
  
  <p>add the adapter. Thanks :)</p>
  
  <pre><code>public class lstAdapter extends BaseAdapter {
  
      private Activity activity;
      private ArrayList&lt;HashMap&lt;String, String&gt;&gt; data;
      private static LayoutInflater inflater=null;
      public ImageLoader imageLoader; 
  
      public MinAdapter(Activity a, ArrayList&lt;HashMap&lt;String, String&gt;&gt; d) {
          activity = a;
          data=d;
          inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          imageLoader=new ImageLoader(activity.getApplicationContext());
      }
  
  
      public int getCount() {
          return data.size();
      }
  
      public Object getItem(int position) {
          return position;
      }
  
      public long getItemId(int position) {
          return position;
      }
  
      public View getView(int position, View convertView, ViewGroup parent) {
          View vi=convertView;
  
  
          if(convertView==null)
              vi = inflater.inflate(R.layout.list_row, null);
  
  
          ImageView thumb_image=(ImageView)vi.findViewById(R.id.list_image); 
          ImageView photo_user =(ImageView)vi.findViewById(R.id.photoUser); 
          LinearLayout background =(LinearLayout)vi.findViewById(R.id.background);
  
          HashMap&lt;String, String&gt; song = new HashMap&lt;String, String&gt;();
          song = data.get(position);
  
  
          imageLoader.DisplayImage(song.get(principal.KEY_AVATAR_AUTOR_ENTRADA), thumb_image);
          imageLoader.DisplayImage(song.get(principal.KEY_PICTURE), photo_user);
          imageLoader.DisplayImageLinear(song.get(principal.KEY_PICTURE), background);
  
  
          return vi;
      }
  
      @Override 
      public boolean isEnabled(int position) 
      { 
          if(principal.asynTaskEnUso.equals("yes")){ 
              return false; 
          } else { 
              return true; 
          } 
  
      } 
  
  }
  </code></pre>