title: reporting drop result : false android
body: <p>I want to save captured image and set them to <strong>gridview</strong> then user can drag &amp; drop to change the position of captured image, that is first image, but I'm very new to use drag &amp; drop function, can you explain it?</p>
  
  <p>How to modify this code ?</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  private Button btPhoto, btSave;
  private GridView gridview;
  private File imgFile;
  private String path;
  private ArrayList&lt;File&gt; List_File;
  private static final int imageCode = 100;
  private Context context;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      btPhoto = (Button) findViewById(R.id.btPhoto);
      btSave = (Button) findViewById(R.id.bt_save);
      gridview = (GridView) findViewById(R.id.gridview);
  
  
      path = "/TongFolder/";
      context = this;
      List_File = new ArrayList&lt;File&gt;();
      File imgDir = new File(Environment.getExternalStorageDirectory()+path);
      imgDir.mkdirs();
      boolean check = imgDir.isDirectory();
      if(check == true){
      btPhoto.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              capture();
  
          }
      });
      }else{
          System.out.println("not create");
      }
   }
  
  
  public void capture(){
      Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
      imgFile = new File(Environment.getExternalStorageDirectory()+path, 
              "img_"+System.currentTimeMillis()+".jpg");
      intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(imgFile));
      startActivityForResult(intent, imageCode);
  }
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data){
  
      if(requestCode == imageCode &amp;&amp; resultCode == RESULT_OK){
  
          //add path to arrayList
          List_File.add(imgFile);
          for (File file : List_File) {
              String showPath = file.getPath();
              System.out.println(showPath);
          }
  
          gridview.setAdapter(new gridViewAdapter(context, List_File));
          if(gridview != null){
              DragDrop();
          }
  
      }
  
  }
  
  public void DragDrop(){
  
      gridview.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
  
          @Override
          public boolean onItemLongClick(AdapterView&lt;?&gt; adapter, View v,
                  int position, long id) {
  
              DragShadow dragshadow = new DragShadow(v);
  
              ClipData data = ClipData.newPlainText("", "");
  
              v.startDrag(data, dragshadow, v, 0);
  
              return true;
  
          }
      }); 
  
  }
  
  OnDragListener dragListener = new OnDragListener() {
  
      @Override
      public boolean onDrag(View v, DragEvent event) {
          int action = event.getAction();
  
          switch (action) {
  
          case DragEvent.ACTION_DRAG_ENTERED:
              Log.i("drag event", "entered");
              break;
  
          case DragEvent.ACTION_DRAG_EXITED:
              Log.i("drag event", "exited");
              break;
  
          case DragEvent.ACTION_DROP:
  
              Log.i("drag event", "drop");
  
              break;
          }
          return true;
      }
  };
  
  private class DragShadow extends View.DragShadowBuilder{
  
      ColorDrawable boxShadow;
  
      public DragShadow(View view) {
          super(view);
          boxShadow = new ColorDrawable(Color.LTGRAY);
      }
  
      @Override
      public void onDrawShadow(Canvas canvas) {
  
          boxShadow.draw(canvas);
      }
  
      @Override
      public void onProvideShadowMetrics(Point shadowSize,
              Point shadowTouchPoint) {
  
          View v = getView();
          int height = (int)v.getHeight();
          int weight = (int)v.getWidth();
  
          boxShadow.setBounds(0, 0, weight, height);
          shadowSize.set(weight, height);
          shadowTouchPoint.set((int)weight/2, (int)height/2);
  
      }
  
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  } 
  </code></pre>