Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cross App Drag and Drop

Cross App Drag and Drop


March 30, 2016

More Decks by funnelbit

Other Decks in Technology


  1. ૹΔଆ 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);
  2. ΋Β͏ଆ root.setOnDragListener(new View.OnDragListener() {
 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;