title: Android: image in listview flickers while calling notifyDataSetChanged on some devices
body: <p>as in title, on some devices images flicker while notifydatasetchanged is being called.</p>
  
  <p>Here is my getView method from my subclass of BaseAdapter:</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup arg2) {
      String infService = Context.LAYOUT_INFLATER_SERVICE;
      LayoutInflater li = (LayoutInflater)context.getSystemService(infService);
      View v = arg1;
      final ViewHolder holder;
  
      if(v == null)
      {
          v = li.inflate(R.layout.row_history_settings, arg2, false);
          holder = new ViewHolder();
  
          holder.flag = (ImageView) v.findViewById(R.id.row_history_settings_image_flag);
          holder.currency = (TextView) v.findViewById(R.id.row_history_settings_text_currency);
          holder.tb = (ToggleButton) v.findViewById(R.id.row_history_settings_tb);
          v.setTag(holder);
      }
      else
      {
          holder = (ViewHolder) v.getTag();
      }
  
      Account account = accounts.get(arg0);
  
      int resID = enabled == true ? Utils.getFlagResIdForCurrency(account.currency()) : Utils.getFlagInactiveResIdForCurrency(account.currency());
  
      if(resID != holder.resId)
      {   
          holder.resId = resID;
          holder.flag.setTag(resID);
          new AsyncImageLoader(holder.flag, context).execute();
      }
  
      holder.currency.setText(account.currency());
      if(currency!=null)
      {
          holder.tb.setChecked(currency.equals(account.currency()));
          holder.tb.setEnabled(true);
      }
      else
      {
          holder.tb.setChecked(false);
          holder.tb.setEnabled(false);
      }
  
      holder.tb.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              currency = holder.currency.getText().toString();
              notifyDataSetChanged();
          }
      });
  
      Utils.enableDisableView(v, enabled);
  
      return v;
  }
  </code></pre>
  
  <p>The holder.flag image flickers for a vary short period every time I click the toggleButton. This appear to happen only on some devices like Sony Xperia U or HTC Desire Z.</p>
  
  <p>Here is my row layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="@dimen/row_list_standard_height"
      android:background="@drawable/list_item_background"
      android:gravity="center_vertical"
      android:orientation="horizontal" &gt;
  
      &lt;ImageView
          android:id="@+id/row_history_settings_image_flag"
          android:layout_width="@dimen/row_list_flag_width"
          android:layout_height="wrap_content"
          android:layout_centerVertical="true"
          android:layout_marginLeft="10dp"
          android:adjustViewBounds="true"
          android:contentDescription="@string/none"
          android:src="@drawable/flag_pln" /&gt;
  
      &lt;com.aliorbank.components.customfont.CustomFontTextView
          android:id="@+id/row_history_settings_text_currency"
          style="@style/textViewUniversalRobotoLightBlack"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerVertical="true"
          android:layout_gravity="left|center_vertical"
          android:layout_marginLeft="20dp"
          android:layout_toRightOf="@id/row_history_settings_image_flag"
          android:text="@string/universal_currency_pln"
          android:textSize="@dimen/font_size_big" /&gt;
  
      &lt;ToggleButton
          android:id="@+id/row_history_settings_tb"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_centerVertical="true"
          android:layout_marginRight="10dp"
          android:background="@drawable/btn_radio_standard"
          android:checked="true"
          android:text="@string/none"
          android:textOff="@string/none"
          android:textOn="@string/none" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and my AsyncIMageLoader class:</p>
  
  <pre><code>public class AsyncImageLoader extends AsyncTask&lt;Object, Void, Bitmap&gt; {
  private final WeakReference&lt;ImageView&gt; imageViewReference;
  private Context context;
  private int resId;
  
  public AsyncImageLoader(ImageView imv, Context context)
  {
      imageViewReference = new WeakReference&lt;ImageView&gt;(imv);
      this.context = context;
      this.resId = (Integer)imv.getTag();
  }
  
  @Override
  protected Bitmap doInBackground(Object... arg0) {
      return BitmapFactory.decodeResource(context.getResources(), resId);
  }
  
  @Override
  protected void onPostExecute(Bitmap result) {
  
      if (imageViewReference != null &amp;&amp; result != null) {
          final ImageView imageView = imageViewReference.get();
          if (imageView != null) {
              imageView.setImageBitmap(result);
          }
      }
  }}
  </code></pre>
  
  <p>It seems to me, that convertView does not correspond to position in getView method. Is there any way to get convertView which corresponds to listview's row position?
  Or maybe there is another solution?</p>