Developers that would like their cached engine to begin
with a custom initial route can configure their cached
FlutterEngine to use a custom initial route just before
executing the Dart entrypoint. The following example
demonstrates the use of an initial route with a cached engine:

Java

Kotlin

public

class

MyApplication

extends

Application

@Override

public

void

onCreate

()

super

onCreate

();

// Instantiate a FlutterEngine.

flutterEngine

new

FlutterEngine

this

);

// Configure an initial route.

flutterEngine

getNavigationChannel

().

setInitialRoute