I am trying to use the following code in my Class:
final ImageView imageView = (ImageView) findViewById(R.id.imageView2);
imageView.setOnTouchListener(new OnSwipeTouchListener(context) {
@Override
public void onSwipeLeft() {
Intent intent2 = new Intent(GalleryView.this, GalleryView2.class);
startActivity(intent2);
finish();
}
});
}
and it gives me the error:
context cannot be resolved to a variable
What does it mean? I have searched all afternoon, and can't find an answer. What should it be instead of context?
Thanks very much.
I got the code from:
Android: How to handle right to left swipe gestures
and used the code from Edward Brey. Unfortunately I don't have enough points to ask Edward Brey directly.
Thanks in advance.