diff options
author | Thanasis Antoniou | 2019-11-08 16:59:52 +0200 |
---|---|---|
committer | Thanasis Antoniou | 2019-11-08 16:59:52 +0200 |
commit | b8c26508c90b7926ea44b40e5bcb2f530b8d1464 (patch) | |
tree | 1dbf0770ea0ed31685469cdefdcecf3feb930e81 /backends/platform/android/org | |
parent | 6fde4e89f85b8091b40569ac5d8e4a34b6007ace (diff) | |
download | scummvm-rg350-b8c26508c90b7926ea44b40e5bcb2f530b8d1464.tar.gz scummvm-rg350-b8c26508c90b7926ea44b40e5bcb2f530b8d1464.tar.bz2 scummvm-rg350-b8c26508c90b7926ea44b40e5bcb2f530b8d1464.zip |
ANDROID: Fix OSD message display crash or fail
For translated message text. Android expected UTF-8 format for the message
Also makeToast for OSD needed to be run from the main UI thread
Diffstat (limited to 'backends/platform/android/org')
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java index dca52a92f3..f55639f60b 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java @@ -76,9 +76,15 @@ public class ScummVMActivity extends Activity { } @Override - protected void displayMessageOnOSD(String msg) { - Log.i(LOG_TAG, "OSD: " + msg); - Toast.makeText(ScummVMActivity.this, msg, Toast.LENGTH_LONG).show(); + protected void displayMessageOnOSD(final String msg) { + if (msg != null) { + Log.i(LOG_TAG, "MessageOnOSD: " + msg + " " + getCurrentCharset()); + runOnUiThread(new Runnable() { + public void run() { + Toast.makeText(ScummVMActivity.this, msg, Toast.LENGTH_SHORT).show(); + } + }); + } } @Override |