FAQS


SimpleGestureListner cannot be resolved to a type

Views: 2678  |   Date: 2013-10-22 05:21:51

1public class SwipeScreenExample extends Activity implements SimpleGestureListner{
2 private simpleGestureFilter detector;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.swipe_screen);

// Detect touched area
detector = new SimpleGestureFilter(this,this);
}

@Override
public boolean dispatchTouchEvent(MotionEvent me){
// Call onTouchEvent of SimpleGestureFilter class
3 this.detector.onTouchEvent(me);
return super.dispatchTouchEvent(me);
}
public void onSwipe(int direction) {
String str = "";

switch (direction) {

case SimpleGestureFilter.SWIPE_RIGHT : str = "Swipe Right";
break;
case SimpleGestureFilter.SWIPE_LEFT : str = "Swipe Left";
break;
case SimpleGestureFilter.SWIPE_DOWN : str = "Swipe Down";
break;
case SimpleGestureFilter.SWIPE_UP : str = "Swipe Up";
break;

}
Toast.makeText(this, str, Toast.LENGTH_SHORT).show();
}

public void onDoubleTap() {
Toast.makeText(this, "Double Tap", Toast.LENGTH_SHORT).show();
}

}

 
Submit Your Answer
  |  
 
 
 

Preview :