My code in custom fileld.
protected boolean touchEvent(TouchEvent event) {
// Figure out where the touch occurred on the screen
int X = event.getX(1);
int Y = event.getY(1);
// Determine if the touch occurred within the extent of this manager
if (getExtent().contains(X, Y)) {
switch (event.getEvent()) {
case TouchEvent.DOWN:
Dialog.alert("down" + getIndex());
return true;
case TouchEvent.UP:
Dialog.alert("up" + getIndex());
return true;
case TouchEvent.CLICK:
Dialog.alert("Clilk"+getIndex());
}
}
// Event wasn't for us, handle in default manner
return super.touchEvent(event);
}
I added two custom fields to Horizontal field manager. First one is working fine but when I click on second field its not responding properly, instead of it, its showing me context menu. What should I do? I think somewhere I did mistake. Please, help me. And one thing what should I need to implement touch event for custom field?