Android Studio - Draw line on canvas and modify the position after it's been drawn : I need help with this thing

I draw line on canvas and i need to be able to modify the position after it's been drawn. I search and try a lot of things, but no one seems that it works

I want to select one of the ends of the line and dragging them in another position

Can someone give me and advice?