I tried the accepted solution here: startDrag method Deprecated and unable to compile the program
So:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
view.startDragAndDrop(data, shadowBuilder, view, 0);
} else {
view.startDrag(data, shadowBuilder, view, 0);
}
But "startDrag" is crossed out and I have an error saying that it is deprecated, which means I can't compile.
I looked here: https://developer.android.com/guide/topics/ui/drag-drop.html
But the example they give is the deprecated solution:
v.startDrag(dragData, // the data to be dragged
myShadow, // the drag shadow builder
null, // no need to use local data
0 // flags (not currently used, set to 0)
);
So what can I use?