Android 2.1 running gesture captured in text mode, but still the context menu opens

The following problem seems unique to 2.1, occurs both on the emulator and on the bundle. The same example works fine on other platforms that I tested ( 1.5, 1.6 and 2.0 emulators).

I added the created gestureListener as described in this post . The difference is that I added a listener to the TextView, which also has a registered contextMenu, i.e. Sth as below:

 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);
     ...
}

During testing, the correct gesture is well recognized, but each time it also causes the context menu to open. Since the same example works on platforms without 2.1, I have a feeling that this is not my code, this is the problem ...

Thanks for any suggestions.

: , -. onFling() "" , .. True, false, , 2.1. , , . ...

+3
1

steelbytes. cancel-and-return-false (27 2010 .), onFling , , 1.6, 2.x.

+1

Source: https://habr.com/ru/post/1744686/


All Articles