为什么此代码无法访问,我该如何解决?
public void draggingEvent() {
image15();
final int thisLetter = currentLetter;
mImageView15.getDrawable();
mImageView15 = (ImageView) findViewById(R.id.imageView15);
mImageView15.setOnDragListener(new OnDragListener() {
public boolean onDrag(View v, DragEvent de) {
// TODO Auto-generated method stub
final int action = de.getAction();
switch(action) {
case DragEvent.ACTION_DRAG_STARTED:
if (de.getClipDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) {
v.invalidate();
return (true);
}
break;
case DragEvent.ACTION_DRAG_ENTERED:
v.invalidate();
return (true);
break; //un reachable here
case DragEvent.ACTION_DRAG_LOCATION:
//ignore even for now
if (de.getX() == 250 && de.getY() == 195) {
mImageView17.setImageResource(thisLetter);
v.invalidate();
return (true);
}
if (de.getX() == 300 && de.getY() == 195) {
mImageView17.setImageResource(thisLetter);
return (true);
}
break;// here
case DragEvent.ACTION_DRAG_EXITED:
de.getResult();
break; //here
case DragEvent.ACTION_DROP:
ClipData.Item item = de.getClipData().getItemAt(thisLetter);
v.invalidate();
return (true);
break; // here
case DragEvent.ACTION_DRAG_ENDED:
v.invalidate();
if (de.getResult()) {
Log.e("it worked", "worked");
} else {
Log.e("failed", "sorry failed drag and drop");
return (true);
}
break; //here
default:
Log.e("Drag drop", "Failed to find area");
break; // and here
};
return false;
};
});