Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
io.flutter.util.HandlerCompat Class Reference

Static Public Member Functions

static Handler createAsyncHandler (Looper looper)
 

Detailed Description

Compatability wrapper over Handler.

Definition at line 14 of file HandlerCompat.java.

Member Function Documentation

◆ createAsyncHandler()

static Handler io.flutter.util.HandlerCompat.createAsyncHandler ( Looper  looper)
inlinestatic

Create a new Handler whose posted messages and runnables are not subject to synchronization barriers such as display vsync.

Messages sent to an async handler are guaranteed to be ordered with respect to one another, but not necessarily with respect to messages from other Handlers. Compatibility behavior:

  • SDK 28 and above, this method matches platform behavior.
  • Otherwise, returns a synchronous handler instance.
Parameters
looperthe Looper that the new Handler should be bound to
Returns
a new async Handler instance
See also
Handler::createAsync(Looper)

Definition at line 31 of file HandlerCompat.java.

31 {
32 if (Build.VERSION.SDK_INT >= API_LEVELS.API_28) {
33 return Handler.createAsync(looper);
34 }
35 return new Handler(looper);
36 }
def Build(configs, env, options)
Definition: build.py:232

The documentation for this class was generated from the following file: