diff -r af4693956263 -r e8c0da59391a src/org/gege/caldavsyncadapter/android/entities/AndroidEvent.java --- a/src/org/gege/caldavsyncadapter/android/entities/AndroidEvent.java Sat Feb 14 00:28:10 2015 +0100 +++ b/src/org/gege/caldavsyncadapter/android/entities/AndroidEvent.java Sat Feb 14 00:30:34 2015 +0100 @@ -72,6 +72,8 @@ import java.net.URISyntaxException; import java.text.ParseException; +import static org.junit.Assert.*; + import com.europalab.caldavsyn.Appctxpro; //import android.accounts.Account; @@ -319,9 +321,12 @@ public boolean createIcs(String strUid) { boolean Result = false; TimeZone timeZone = null; - //Thread.currentThread().setContextClassLoader(Context.getApplicationContext().getClassLoader()); - Thread.currentThread().setContextClassLoader(Appctxpro.getContext().getClassLoader()); - TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry(); + // Hack to bootstrap a multithreaded class loader context + if (Thread.currentThread().getContextClassLoader() == null) + Thread.currentThread().setContextClassLoader(Appctxpro.getContext().getClassLoader()); + TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance(); + assertNotNull(registry); + registry.createRegistry(); //TODO: do not simply create the ics-file new. take into account the RAWDATA if available /* * dtstart=1365598800000