I\'m attempting to utilize Gestures within a fragment; I have the following inside of a FragmentActivity which handles my details fragment. What I am attempting to have hap
a couple comments
I had to tweak my code as follows:
v.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// return gesture.onTouchEvent(event);
gesture.onTouchEvent(event);
return true; // <-- this line made the difference
}
});
Also, if you are using an xml file to create your view
View v = inflater.inflate(R.layout.my_view, null, false);
make sure you are actually pressing the intended view. A nice way to exaggerate the test is to make both the width and the height to "match_parent" instead of "wrap_content" in your layout xml file.