Android Question mised evet

Discussion in 'Android Questions' started by yaniv hanya, Jun 27, 2019.

  1. yaniv hanya

    yaniv hanya 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?
     
  2. Brandsum

    Brandsum Active 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: Jun 27, 2019
    OliverA likes this.
  3. OliverA

    OliverA Expert Licensed User

    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)
     
    Erel likes this.
  4. yaniv hanya

    yaniv hanya 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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice