Saturday, 14 September 2013

Wait until method has finished to call the method again

Wait until method has finished to call the method again

I have a method which "does stuff" do my ListView called method1(). This
is called from method2(). method2() can run very frequently (possibly
every second). I think I have a problem that if method2() is called
(therefore calling method1() again) before method1() has finished, method1
only runs the once - it does not run the second time.
Is there a way around this? I thought about adding a boolean into
method1() and setting it to true at the start and the false at the end,
but I can't think of a way I can get this to work.

No comments:

Post a Comment