Skip to content Skip to sidebar Skip to footer

Drag View From Activity And Drop It In New Fragment Android

i try to implement a Drag and Drop in my app, I drag the view from my Activity, and i want drop it in new Fragment created in the moment when drag start, but don't work the Drag Li

Solution 1:

If your application's min sdk version is 11, then this works,

We have getters and setters for X,Y coordinates , width and height of a view. Using these methods, we can move a view all over the screen.

So, what i do to accomplish your task is,

1) I start updating x position of a view in onTouchListener of the view. 2) As soon as i start, simultaneously i create a fragment. 3) When my view reaches the fragment i will finish() the activity and add the same layout to the fragment.

In this way we can illute.

Hope this helps..


Post a Comment for "Drag View From Activity And Drop It In New Fragment Android"