title: How to call onItemSelected programmatically?
body: <p>After I made a call of notifyDataSetChanged, all my references from onItemSelected are outofdate. </p>
  
  <p>e.g</p>
  
  <pre><code>gallery.setOnItemSelectedListener(new OnItemSelectedListener() {
              @Override
              public void onItemSelected(AdapterView&lt;?&gt; parent, View view,
                      int position, long id) {
                  onFront1 = (ImageView) view;
  
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
                  // TODO Auto-generated method stub
  
              }
          });
  </code></pre>
  
  <p>getView</p>
  
  <pre><code>public View getView(final int position, View convertView,
                  ViewGroup parent) {
  
               imView = new ImageView(this.myContext);
  
              imView.setLayoutParams(new Gallery.LayoutParams(
                      LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
              imView.setOnTouchListener(new OnTouchListener() {
  
  
                  public boolean onTouch(View v, MotionEvent event) {
  
                      ImageView view = (ImageView) v;
  
                      onFront2 = view;
                      return true; // indicate event was handled
                  }
              });
              onFront3 = imView;
              return imView;
          }
  </code></pre>
  
  <p>rotate</p>
  
  <pre><code>public void rotateS(View v) {
          ImageView iv = onFront;
          Bitmap b = ((BitmapDrawable) iv.getDrawable()).getBitmap();
          Matrix matrix = new Matrix();
          matrix.postRotate(geg);
          Bitmap bMapRotate = Bitmap.createBitmap(b, 0, 0, b.getWidth(),
                  b.getHeight(), matrix, true);
          iv.setImageBitmap(bMapRotate);
          geg = 90;
          Log.d("rorate", "yes");
      }
  </code></pre>
  
  <p><code>onFront</code> references the old imageView, thus I cannot use it any more. How can I call onItemselected again?</p>
  
  <p>A bit more detailed:</p>
  
  <p>I am taking imageView and use it in <code>rotateS</code> function. It uses onFront but replace it with global variables onFront1|onFront2|onFront3<br>
  onFron1 allows rotate image as soon as it appears on screen, but became useless after notifydatasetChanged.<br>
  onFront2  is not affected by notifyDataSetChanged, but it works only after screen was taped ( prety logical)<br>
  onFront3 does not work at all.<br>
  What I want to achieve - hold reference to current imageview and update it as soon as imageview was updated.</p>