Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
call invokeMethod on the main thread
  • Loading branch information
Sander Roest committed Jan 12, 2021
commit 2e398a035904b50feabba3dc65f0ff711dc68f48
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.flutter.plugins.camera;

import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import io.flutter.plugin.common.BinaryMessenger;
Expand Down Expand Up @@ -64,6 +66,11 @@ void send(EventType eventType, Map<String, Object> args) {
if (channel == null) {
return;
}
channel.invokeMethod(eventType.toString().toLowerCase(), args);
new Handler(Looper.getMainLooper()).post(new Runnable () {
@Override
public void run () {
channel.invokeMethod(eventType.toString().toLowerCase(), args);
}
});
}
}