How to prevent Multi Touch from allowing touching two Listview items at the same time

Asked

Viewed 357 times

1

I’m developing a Sales/Budgets application, and I’m having a problem with a listview custom, where the user is able to click 2 lines at once, calling 2 times the events and causing exception in the database. I need to deactivate this multitouch, someone knows how I can do it?

Here’s a print of the application:

inserir a descrição da imagem aqui

1 answer

1

Try using the property splitMotionEvents in the layout of your ListView:

android:splitMotionEvents="false"
  • Boa Tarde @Paulo Rodrigues, thank you for your suggestion. I have tried to use this property, however, it did not work as I need, because with this property in listview, I can not click the 2 at the same time, but if you give 2 touches a logo after the other in a listview item, the dialog that is called in the event will burst 2 times, to which the second time creates an exception. How to set a delay type in the 500 millisecond listview, until the dialog opens?

  • @Paulovescovi, I think in this case you would have to treat using some flag or checking if the Dialog is already being displayed. As far as I know, there’s no way to limit the event handling rate.

  • Thanks for the @Wakim suggestion, I’ll try here. vlw

  • 1

    @Paulovescovi The right answer to this question is this. This solution just doesn’t solve for you because your problem is another. I suggest you accept this answer and open a specific question about very fast simultaneous clicks.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.