Android Question mised evet

yaniv hanya

Active Member
Licensed User
Hello
I have a button that I want to capture both his click event and his Btn1_Up. (And expects the click to be before the Btn1_Up). But in Digger it seems that he only catch theBtn1_Up event
why?
 

Brandsum

Well-Known Member
Licensed User
If you use a panel you can detect touch up and touch down. Add a label inside the panel and set panel elevation to 5/6dip and set corner radius to 3/4dip to make it look like a button.
 
Last edited:
Upvote 0

OliverA

Expert
Licensed User
Longtime User
But in Digger it seems that he only catch theBtn1_Up event
I'm guessing you are talking about the Designer. In the designer, the only events for buttons are Click and LongClick. The reason that you do not see Up/down events is that they are unreliable (see https://www.b4x.com/android/forum/threads/button-down-up.74841/#content). As @Brandsum suggests, use panel (see https://www.b4x.com/android/forum/threads/b4a-button-down-up-event-bounce.70067/#post-445028 and https://www.b4x.com/android/forum/threads/button_down-button_up-events-fire-twice.80889/#post-512581)
 
Upvote 0

yaniv hanya

Active Member
Licensed User
In fact, what probably happened is that the theBtn1_Up event happened anyway, even though I did not leave the button. And then the click envent.
Only in the debugger it is probably impossible to debug both one after the other, but as soon as I remove the break points from the theBtn1_Up event he stops at the break point of the click event
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…