Buggy code:
public class CalendarActivity extends ActionBarActivity { int [ ] [ ] eventDates ; JSONObject jobj = null ; JSONArray jarr = null ; ClientServerInterface clientServerInterface = new ClientServerInterface ( ) ; String startDatetime = "" ; String endDatetime = "" ; String date = "" ; String time = "" ; String year = "" ; String month = "" ; String day = "" ; String hour = "" ; String minute = "" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_calendar ) ; ExtendedCalendarView calendar = ( ( ExtendedCalendarView ) ( findViewById ( calendar ) ) ) ; getContentResolver ( ) . delete ( CONTENT_URI , null , null ) ; ContentValues values = new ContentValues ( ) ; CalendarActivity . RetrieveData rd = new CalendarActivity . RetrieveData ( ) ; rd . execute ( ) ; try { <START_BUG> rd . get ( 1000 , TimeUnit . MILLISECONDS ) ; <END_BUG> } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } catch ( ExecutionException e ) { e . printStackTrace ( ) ; } catch ( TimeoutException e ) { e . printStackTrace ( ) ; } eventDates = new int [ jarr . length ( ) ] [ 6 ] ; Calendar cal = Calendar . getInstance ( ) ; TimeZone tz = TimeZone . getDefault ( ) ; for ( int i = 0 ; i < ( jarr . length ( ) ) ; i ++ ) { try { jobj = jarr . getJSONObject ( i ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } try { startDatetime = jobj . getString ( "startDate" ) ; endDatetime = jobj . getString ( "endDate" ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } date = startDatetime . split ( "<seq2seq4repair_space>" ) [ 0 ] ; time = startDatetime . split ( "<seq2seq4repair_space>" ) [ 1 ] ; year = date . split ( "-" ) [ 0 ] ; month = date . split ( "-" ) [ 1 ] ; day = date . split ( "-" ) [ 2 ] ; hour = time . split ( ":" ) [ 0 ] ; minute = time . split ( ":" ) [ 1 ] ; values . put ( COLOR , COLOR_RED ) ; try { values . put ( DESCRIPTION , jobj . getString ( "description" ) ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } try { values . put ( LOCATION , jobj . getString ( "location" ) ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } try { values . put ( EVENT , jobj . getString ( "title" ) ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } cal . set ( Integer . parseInt ( year ) , ( ( Integer . parseInt ( month ) ) - 1 ) , Integer . parseInt ( day ) , Integer . parseInt ( hour ) , Integer . parseInt ( minute ) ) ; int StartDayJulian = Time . getJulianDay ( cal . getTimeInMillis ( ) , TimeUnit . MILLISECONDS . toSeconds ( tz . getOffset ( cal . getTimeInMillis ( ) ) ) ) ; values . put ( START , cal . getTimeInMillis ( ) ) ; values . put ( START_DAY , StartDayJulian ) ; eventDates [ i ] [ 0 ] = Integer . parseInt ( year ) ; eventDates [ i ] [ 1 ] = Integer . parseInt ( month ) ; eventDates [ i ] [ 2 ] = Integer . parseInt ( day ) ; date = endDatetime . split ( "<seq2seq4repair_space>" ) [ 0 ] ; time = endDatetime . split ( "<seq2seq4repair_space>" ) [ 1 ] ; year = date . split ( "-" ) [ 0 ] ; month = date . split ( "-" ) [ 1 ] ; day = date . split ( "-" ) [ 2 ] ; hour = time . split ( ":" ) [ 0 ] ; minute = time . split ( ":" ) [ 1 ] ; cal . set ( Integer . parseInt ( year ) , ( ( Integer . parseInt ( month ) ) - 1 ) , Integer . parseInt ( day ) , Integer . parseInt ( hour ) , Integer . parseInt ( minute ) ) ; int endDayJulian = Time . getJulianDay ( cal . getTimeInMillis ( ) , TimeUnit . MILLISECONDS . toSeconds ( tz . getOffset ( cal . getTimeInMillis ( ) ) ) ) ; values . put ( END , cal . getTimeInMillis ( ) ) ; values . put ( END_DAY , endDayJulian ) ; eventDates [ i ] [ 3 ] = Integer . parseInt ( year ) ; eventDates [ i ] [ 4 ] = Integer . parseInt ( month ) ; eventDates [ i ] [ 5 ] = Integer . parseInt ( day ) ; getContentResolver ( ) . insert ( CONTENT_URI , values ) ; } calendar . refreshCalendar ( ) ; calendar . setOnDayClickListener ( new ExtendedCalendarView . OnDayClickListener ( ) { @ Override public void onDayClicked ( AdapterView < ? > adapter , View view , int position , long id , Day day ) { for ( int i = 0 ; i < ( eventDates . length ) ;

Fix:
rd . get ( 2000 , TimeUnit . MILLISECONDS ) ;