How to properly implement onFling method?

view story

http://stackoverflow.com – I have tried to implement the Android onFling method where I set a listener in the on create and implement the method further down the class. But the problem is I get these errors in onCreate(), detector cannot be resolved and The method setOnTouchListener(View.OnTouchListener) is undefined for the type GalleryStudent . public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_galery_student); View.OnTouchListener gestureListener = new View.OnTouchListener() { public boolean o (HowTos)