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
This commit is contained in:
parent
9345c1addc
commit
66b3527a22
@ -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);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user