Skip to content

Commit

Permalink
[gdgtoledo#77] Do not use Level 21 code on lower Android versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Oct 22, 2016
1 parent a3d323f commit e7df397
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,14 @@ else if (time < 10) {
return;
}

NumberFormat numberFormat = NumberFormat.getInstance(Locale.forLanguageTag("ES"));
NumberFormat numberFormat;

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
numberFormat = NumberFormat.getInstance(Locale.forLanguageTag("ES"));
}
else {
numberFormat = NumberFormat.getNumberInstance();
}

String formattedTime = numberFormat.format(time);

Expand Down

0 comments on commit e7df397

Please sign in to comment.