Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The import android.* cannot be resolved for drag and drop example

Tags:

android

I am new to java and android.I am following and making app from here for drag and drop.

the following files are giving error of cannot be resolved.

import android.view.View.DragShadowBuilder;
import android.view.View.OnDragListener;
import android.view.DragEvent;
import android.content.ClipData;

I know that means the above mentioned classes are not present in main library. how should i add them or is there alternate way of doing drag and drop(please explain with give examples).

like image 830
karan421 Avatar asked Feb 20 '23 14:02

karan421


2 Answers

Right click on your projects --> properties --> android ----> set target 4.0

Refer this links,

http://www.edumobile.org/android/android-beginner-tutorials/drag-and-drop-ui-element/

http://techdroid.kbeanie.com/2010/04/simple-drag-n-drop-on-android.html

like image 72
rajeshwaran Avatar answered Feb 22 '23 03:02

rajeshwaran


Try Right Click --> Android Tools --> Fix Project Properties, It worked for me.

like image 26
san Avatar answered Feb 22 '23 03:02

san