Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag Image on Touch

I want to drag an image on the screen.
how can i do this?
In my case, the image is simply download from the URL and placed on an activity.
I just want to drag this.

Thanks in advance!!

like image 905
Noman Avatar asked Nov 04 '22 09:11

Noman


2 Answers

You can do that with this -

@Override
public void onDraw(Canvas canvas) 
{
    canvas.drawColor(Color.BLACK);
    canvas.drawBitmap(mBitmap, 10, 10, null);
}

And follow this tutorial. It can help you in step-by-step basis.

like image 177
Praveenkumar Avatar answered Nov 13 '22 19:11

Praveenkumar


please download the default android drag and drop source code

please check this code

like image 33
mayur rahatekar Avatar answered Nov 13 '22 19:11

mayur rahatekar