views:

244

answers:

0

The following problem seems unique to 2.1, happens both on an emulator and on a nexus. The same example works fine on other platforms I've tested (1.5, 1.6 and 2.0 emulators).

I've added created gestureListener as described in this post. The difference is that I've added the listener on a TextView which also has a contextMenu registered, i.e. sth like the following:

 onCreate(...) {
     ...
     // Layout contains a large TextView on which I want to add a context menu
     tv = findViewById(R.id.text_view);
     tv.registerForContextMenu(this);

     // create the gestureListener according above mentioned post.
     gestureListener = ...
     // set the listener on the text-view
     tv.setOnTouchListener(gestureListener);
     ...
}

When testing it, the correct gesture is recognized alright, but every other time it also causes the context menu to be opened. As the same example is working on non 2.1 platforms, I've got a feeling it is not my code that is the problem...

Thankful for any suggestions.

Update: Seems that the return value is flipped somewhere. If I let onFling() return the "wrong" value, i.e. true when the event is skipped and false when it was consumed, it works correctly in 2.1. But of course, that doesn't work on the other platforms. Seems like its time for an ugly workaround...