When I press on a ListView item, my app makes a call to server. If, while that call is being made, somebody presses in another item, it makes another call that often crashes my app.
I don’t want the UI to lag either, and I want the ListView to be able to scroll. I just don’t want it to react to any click events.
My calls have a callback, so if there’s a way to do this smoothly I’d just enable it on item click and then disable it when the callback gets called.
Is there any way to achieve this?
I think you’re trying to fix the wrong problem. You shouldn’t disable ListView clicks while your operation runs, but rather queue the operation or disable it while another is running. The latter should be relatively simple with a static boolean semaphore.