Skip to content

Commit

Permalink
Fix sonarcloud issue (deprecated Locale)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keidan committed Mar 29, 2024
1 parent 62fc256 commit 78bee44
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/src/main/java/fr/ralala/hexviewer/ApplicationCtx.java
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,10 @@ public Context onAttach(Context context) {
String lang = getApplicationLanguage(context);
mLanguage = lang;
String[] split = lang.split("-");
Locale locale;
Locale.Builder builder = new Locale.Builder().setLanguage(split[0]);
if (split.length == 2)
locale = new Locale(split[0], split[1]);
else
locale = new Locale(split[0]);

builder.setRegion(split[1]);
Locale locale = builder.build();
Locale.setDefault(locale);

Configuration configuration = context.getResources().getConfiguration();
Expand Down

0 comments on commit 78bee44

Please sign in to comment.