Problem
Looking at the logcat, I get that message every time I "longpress"
- 09-04 14:45:26.052: W/TextView(623): TextView does not support text selection. Action mode cancelled.
If i get that message then I dont get the singletap event.
Tested on
Confirmed on Samgsung Galaxy Tab Android OS 3.2
Test case
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var label = Ti.UI.createLabel({
text: 'Touch the Button!', textAlign: 'center',
top: 0, right: 0, bottom: '50%', left: 0
});
win.add(label);
var button = Ti.UI.createButton({
title: 'Update Label',
top: '50%', right: 0, bottom: 0, left: 0
});
win.add(button);
var launch = new Date().getTime();
button.addEventListener('singletap', function() {
label.text = parseInt((new Date().getTime() - launch) / 100) / 10 + ' seconds since app launched.';
});
win.open();
Not seeing the actual device this was tested on, but basically onSingleTap event is notified when a tap occurs with the up MotionEvent that triggered it. MotionEvent overview: Some devices can report multiple movement traces at the same time. http://developer.android.com/reference/android/view/MotionEvent.html Do you get the same result if using a click event listener?
Tested and confirmed on Samgsung Galaxy Tab Android OS 3.2. To clarify: 'singletap' is not fired and the message "TextView does not support text selection. Action mode cancelled." appears in logcat when holding the button down for longer than a tap gesture. It is fired with no message when tapping without holding.
@Eduardo: You are right the 2 other bugs where on ios, yes. But in a multi platform situation, having singletap and click problems is not that good. That s what i wanted to point out. As for the device, if i didnt mention device/simulator, is because it was clearly happening on both. Especially as i pointed out that it certainly was just a question of implementation. Thanks for your feedback
Format corrected, added the test device & parity label. Moving to Titanium Project to dig into it - it's potentially native behavior.
Hi in your case the long press was handled by longpress event rather than singletap event.