Buggy code:
public class rhestr extends Activity { ZenossAPIv2 API = null ; private SharedPreferences settings = null ; JSONObject EventsObject = null ; JSONArray Events = null ; List < ZenossEvent > listOfZenossEvents = new ArrayList < ZenossEvent > ( ) ; private boolean totalFailure = false ; private int EventCount = 0 ; Thread dataPreload ; Thread AckEvent ; volatile Handler handler ; volatile Handler AckEventHandler ; ProgressDialog dialog ; ListView list ; ZenossEventsAdaptor adapter ; @ Override public Object onRetainNonConfigurationInstance ( ) { } @ SuppressWarnings ( "unchecked" ) @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; settings = getSharedPreferences ( "rhybudd" , 0 ) ; requestWindowFeature ( FEATURE_NO_TITLE ) ; setContentView ( skinned_eventlist ) ; list = ( ( ListView ) ( findViewById ( ZenossEventsList ) ) ) ; ImageView refreshButton = ( ( ImageView ) ( findViewById ( RefreshViewImage ) ) ) ; refreshButton . setClickable ( true ) ; refreshButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { listOfZenossEvents . clear ( ) ; list . setAdapter ( null ) ; CreateThread ( ) ; dataPreload . start ( ) ; } } ) ; ImageView deviceListButton = ( ( ImageView ) ( findViewById ( DeviceListImage ) ) ) ; deviceListButton . setClickable ( true ) ; deviceListButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent DeviceListIntent = new Intent ( rhestr . this , DeviceList . class ) ; rhestr . this . startActivity ( DeviceListIntent ) ; } } ) ; handler = new Handler ( ) { public void handleMessage ( Message msg ) { dialog . dismiss ( ) ; if ( ( totalFailure ) == false ) { if ( ( EventCount ) > 0 ) { UpdateErrorMessage ( "" , false ) ; adapter = new ZenossEventsAdaptor ( rhestr . this , listOfZenossEvents ) ; list . setAdapter ( adapter ) ; } else { UpdateErrorMessage ( "There<seq2seq4repair_space>are<seq2seq4repair_space>no<seq2seq4repair_space>open<seq2seq4repair_space>events" , false ) ; } } else { UpdateErrorMessage ( "There<seq2seq4repair_space>was<seq2seq4repair_space>a<seq2seq4repair_space>problem<seq2seq4repair_space>fetching<seq2seq4repair_space>the<seq2seq4repair_space>events<seq2seq4repair_space>list" , true ) ; } } } ; AckEventHandler = new Handler ( ) { public void handleMessage ( Message msg ) { if ( ( msg . what ) == 0 ) { adapter . notifyDataSetChanged ( ) ; } else if ( ( msg . what ) == 1 ) { adapter . notifyDataSetChanged ( ) ; } else { Toast . makeText ( getApplicationContext ( ) , "There<seq2seq4repair_space>was<seq2seq4repair_space>an<seq2seq4repair_space>error<seq2seq4repair_space>trying<seq2seq4repair_space>to<seq2seq4repair_space>ACK<seq2seq4repair_space>that<seq2seq4repair_space>event." , LENGTH_SHORT ) . show ( ) ; } } } ; listOfZenossEvents = ( ( List < ZenossEvent > ) ( getLastNonConfigurationInstance ( ) ) ) ; if ( ( ( listOfZenossEvents ) == null ) || ( ( listOfZenossEvents . size ( ) ) < 1 ) ) { listOfZenossEvents = new ArrayList < ZenossEvent > ( ) ; CreateThread ( ) ; dataPreload . start ( ) ; } else { Log . i ( "rhestr" , "We<seq2seq4repair_space>already<seq2seq4repair_space>had<seq2seq4repair_space>data!" ) ; UpdateErrorMessage ( "" , false ) ; <START_BUG> ZenossEventsAdaptor adapter = new ZenossEventsAdaptor ( this , listOfZenossEvents ) ; <END_BUG> list . setAdapter ( adapter ) ; } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } public void CreateThread ( ) { } public void ViewEvent ( String EventID ) { } public void AcknowledgeEvent ( final String EventID , final int Position , final int viewID ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void UpdateErrorMessage ( String MessageText , boolean Critical ) { } No newline ; at end ; of file ; }

Fix:
adapter = new ZenossEventsAdaptor ( this , listOfZenossEvents ) ;