Package com.pubmatic.sdk.common.utility
Class POBLooper
-
- All Implemented Interfaces:
@MainThread() public class POBLooper
Provides looping functionality, User of this class must call loop method to start looper timer and should register to setListener in order to identify looper has completed it's loop time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfacePOBLooper.LooperListenerInvocation callback after looper completed its loop time
-
Constructor Summary
Constructors Constructor Description POBLooper()
-
Method Summary
Modifier and Type Method Description synchronized voidloop(long delayTime)Start loop with provided delay, when delay is lapsed looper will call invoke method on LooperListener Invocation is made only once for one loop method call synchronized voidforceResume()synchronized voidresume()Resumes the looper from paused state synchronized voidforcePause()synchronized voidpause()Pauses the looper from resumed state voidsetNetworkMonitor(@NonNull() POBNetworkMonitor networkMonitor)Sets Network monitor, It notifies about change in device network connectivity voidsetListener(@Nullable() POBLooper.LooperListener listener)Method to set the LooperListener synchronized voiddestroy()Destroys the internal state of this Looper. -
-
Method Detail
-
loop
synchronized void loop(long delayTime)
Start loop with provided delay, when delay is lapsed looper will call invoke method on LooperListener Invocation is made only once for one loop method call
- Parameters:
delayTime- in second value to delay looper
-
forceResume
synchronized void forceResume()
-
resume
synchronized void resume()
Resumes the looper from paused state
-
forcePause
synchronized void forcePause()
-
pause
synchronized void pause()
Pauses the looper from resumed state
-
setNetworkMonitor
void setNetworkMonitor(@NonNull() POBNetworkMonitor networkMonitor)
Sets Network monitor, It notifies about change in device network connectivity
- Parameters:
networkMonitor- POBNetworkMonitor instance
-
setListener
void setListener(@Nullable() POBLooper.LooperListener listener)
Method to set the LooperListener
- Parameters:
listener- LooperListener instance
-
destroy
synchronized void destroy()
Destroys the internal state of this Looper. This method should be called after use of Looper. No other methods may be called on this WebView Looper destroy.
-
-
-
-