How to add a button in android application at a position described by touch dynamically?
Imagine I have a blank activity, and on touch using the on touch listener I can get the x,y co ordinates. When I touch I want to insert the button at the position(x,y) I touched dynamically. How do I do it?
I had a lot of widgets on my layout. So I initially kept them all invisible and on touch assigned the new x,y co ordinates w.r.t. the touch and moved the widgets (eg button) by using “Object Animator” to the x,y coordinate of the touch.