Fix: Improper character encoding upon default control selection

This commit is contained in:
Boulay Mathias 2023-01-26 13:30:33 +01:00 committed by GitHub
parent 3f8e49f530
commit 1d30eabfdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,7 +220,7 @@ public class CustomControlsActivity extends BaseActivity {
private static void setDefaultControlJson(String path,ControlLayout ctrlLayout) {
// Load before save to make sure control is not error
try {
ctrlLayout.loadLayout(Tools.GLOBAL_GSON.fromJson(Tools.read(path), CustomControls.class));
ctrlLayout.loadLayout(path);
LauncherPreferences.DEFAULT_PREF.edit().putString("defaultCtrl", path).apply();
LauncherPreferences.PREF_DEFAULTCTRL_PATH = path;
} catch (IOException| JsonSyntaxException exception) {