Skip to content

Commit

Permalink
Gate locale.getScript() behind version check for android API < 21 (fl…
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryQian authored Oct 18, 2018
1 parent c176244 commit 09dcc3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shell/platform/android/io/flutter/view/FlutterView.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ private void setLocales(Configuration config) {
List<String> data = new ArrayList<String>();
data.add(locale.getLanguage());
data.add(locale.getCountry());
data.add(locale.getScript());
if (Build.VERSION.SDK_INT >= 21) {
data.add(locale.getScript());
} else {
data.add("");
}
data.add(locale.getVariant());
mFlutterLocalizationChannel.invokeMethod("setLocale", Arrays.asList(locale.getLanguage(), locale.getCountry(), locale.getScript(), locale.getVariant()));

Expand Down

0 comments on commit 09dcc3d

Please sign in to comment.