swap images in grid view using OnTouchListener
<p>I am making an application where i need to swap images in grid view . here is the code ...
how could i achieve swapping :</p>

<p>activity</p>

<pre><code>public class GameActivity extends Activity
    implements OnTouchListener  
{

     @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //Intent intent = getIntent();
    setContentView(R.layout.layout_game);

    //create grid view
    splitImage(); 
    GridView gridView = new GridView(this);
    gridView = (GridView)findViewById(R.id.grid_view);   
    final ImageAdapter images = new ImageAdapter(this,chunkedImages);
    final GridView gV = gridView;
    gridView.setAdapter(images);
    gridView.setOnTouchListener(this);

}

public boolean onTouch(View v, MotionEvent me) {

    switch(me.getAction())
    {

    case MotionEvent.ACTION_DOWN :

        Toast.makeText(GameActivity.this, "down ", Toast.LENGTH_SHORT).show();
        break;
    case MotionEvent.ACTION_UP :

        Toast.makeText(GameActivity.this, "up " , Toast.LENGTH_SHORT).show();
        break;
    case MotionEvent.ACTION_MOVE :
        //Toast.makeText(GameActivity.this, "move", Toast.LENGTH_SHORT).show();
        break;
    }
    return true;
}

 }
</code></pre>

<p>on touching the image it gives toast as down and on removing the fingure gives up . But how to swap image i could not understand.</p>
