Commit 37e0eb1e by Lee Munkyeong

Android6以下バージョンでのLocale取得対応

parent bc84c3d7
...@@ -1552,7 +1552,12 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1552,7 +1552,12 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
public String getLocaleFileName() { public String getLocaleFileName() {
Locale primaryLocale = mContext.getResources().getConfiguration().getLocales().get(0); Locale primaryLocale;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
primaryLocale = mContext.getResources().getConfiguration().getLocales().get(0);
} else {
primaryLocale = mContext.getResources().getConfiguration().locale;
}
String locale = primaryLocale.getDisplayName(); String locale = primaryLocale.getDisplayName();
String localeLanguage = "en"; String localeLanguage = "en";
if (primaryLocale.equals(Locale.JAPAN) || primaryLocale.equals(Locale.JAPANESE)) { if (primaryLocale.equals(Locale.JAPAN) || primaryLocale.equals(Locale.JAPANESE)) {
......
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 to comment