Commit 66b3527a by andrewlewis Committed by Ian Baker

Fix demo app crash when media pipe isn't loaded

The toast message about media pipe not loading needs to be shown on the main
(UI) thread.

PiperOrigin-RevId: 449199285
parent 9345c1ad
......@@ -266,7 +266,7 @@ public final class TransformerActivity extends AppCompatActivity {
/* inputStreamName= */ "input_video",
/* outputStreamName= */ "output_video");
} catch (Exception e) {
showToast(R.string.no_media_pipe_error);
runOnUiThread(() -> showToast(R.string.no_media_pipe_error));
throw new RuntimeException("Failed to load MediaPipe processor", e);
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment