From e7e7759f41614eeeb740299db0f8b936719d48df Mon Sep 17 00:00:00 2001 From: Oliver Gerlich Date: Wed, 13 Nov 2013 22:09:14 +0100 Subject: [PATCH] fix NumberFormatException when parsing "ff" alpha value into a Byte --- src/at/bitfire/davdroid/resource/LocalCalendar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/at/bitfire/davdroid/resource/LocalCalendar.java b/src/at/bitfire/davdroid/resource/LocalCalendar.java index 569bc8ba..73c37800 100644 --- a/src/at/bitfire/davdroid/resource/LocalCalendar.java +++ b/src/at/bitfire/davdroid/resource/LocalCalendar.java @@ -99,7 +99,7 @@ public class LocalCalendar extends LocalCollection { Matcher m = p.matcher(info.getColor()); if (m.find()) { int color_rgb = Integer.parseInt(m.group(1), 16); - byte color_alpha = m.group(2) != null ? Byte.parseByte(m.group(2), 16) : -1; + int color_alpha = m.group(2) != null ? (Integer.parseInt(m.group(2), 16) & 0xFF) : 0xFF; color = (color_alpha << 24) | color_rgb; } }