-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Let's say that we continue exposing the android activity via some method such as Jni.androidActivity(int engineId). As long as we're running this on the main thread, in a synchronous method, it's fine to use it.
final a = Jni.androidActivity(PlatformDispatchers.instance.engineId);
Foo.method(a); // this is fineHowever, if there is an async gap between the two, the code might be incorrect as the activity itself might have been changed:
final a = Jni.androidActivity(PlatformDispatchers.instance.engineId);
await someFuture; // async gap
Foo.method(a); // no longer ok, `a` might be incorrect.This also means that the user should not be using the activity from other isolates.
We need to write these limitations in the documentation of androidActivity.
There are other things that this design doesn't resolve, namely the we would want to add various listeners to ActivityPluginBindings.
What is a general way to do something like image_picker?
Metadata
Metadata
Assignees
Type
Projects
Status
No status