ImageView Drag/Select
<p>I'm using this code:</p>

<pre><code>public class Card extends ImageView 
{
    public Card (Context context) {
        super (context);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        int eventaction = event.getAction();
        int X = (int)event.getX();
        int Y = (int)event.getY();
        switch (eventaction ) {
            case MotionEvent.ACTION_DOWN: 
                setAlpha(128);
                break;
            case MotionEvent.ACTION_MOVE:
                setPosition(X, Y);
                break;
            case MotionEvent.ACTION_UP:
                setAlpha(255);
                break;
        }
        return true;
    }

    @Override
    public void onDraw(Canvas canvas) 
    {
        super.onDraw(canvas);
    }

    @Override
    public void setImageResource(int resource) {
        setImageBitmap(BitmapFactory.decodeResource(getResources(), resource));
        layoutParams = new RelativeLayout.LayoutParams(image.getWidth(), image.getHeight());
        setLayoutParams(layoutParams);
    }

    Bitmap image;
    @Override
    public void setImageBitmap(Bitmap bitmap)
    { 
        image = bitmap;
        super.setImageBitmap(image);
    }

    public RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(0, 0);
    public void setPosition(int x, int y)
    { 
        layoutParams.leftMargin = x;
        layoutParams.topMargin = y;
        setLayoutParams(layoutParams);
        invalidate();
    }
}
</code></pre>

<p>After some work i get image dragged, but now it make a strange flickering effect
Anyone can tell me why?</p>
