java - Android: how to stop calling the same function while the function is running -


example: got button, if press call function fetch data api screen. how can stop calling function if user press again , function still running(processing).

instead of hiding button there way handle it? need use thread handle it? check if thread alive? not familiar that. please give me suggestion , example on how handle it.

sorry bad english. thanks.

make boolean turns true when press button. when true normal functions of method. make when person presses button again boolean turns false. when false make want break out or return or nothing.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -