Cross App Drag and Drop

Cross App Drag and Drop

8928b5277aa7234dbca4ff782952343a?s=128

funnelbit

March 30, 2016
Tweet

Transcript

  1. 3.
  2. 14.

    ૹΔଆ ClipData.Item item = new ClipData.Item("ςΩετ");
 
 String[] mimeType =

    new String[1];
 mimeType[0] = ClipDescription.MIMETYPE_TEXT_PLANE;
 
 ClipData clipData = new ClipData( new ClipDescription("text", mimeType), item); 
 textView.startDragAndDrop(clipData, new MyDragShadowBuilder(view), null, View.DRAG_FLAG_GLOBAL);
  3. 15.

    ΋Β͏ଆ root.setOnDragListener(new View.OnDragListener() {
 @Override
 public boolean onDrag(View view, DragEvent

    dragEvent) {
 if (dragEvent.getAction() == DragEvent.ACTION_DROP) {
 String item = dragEvent.getClipData().getItemAt(0).getUri();
 Log.e("text", item.toString());
 }
 return true;
 }
 });
  4. 16.