Buggy code:
public class EventDisplayActivity extends FragmentActivity implements GoogleApiClient . ConnectionCallbacks , GoogleApiClient . OnConnectionFailedListener , LocationListener , OnMapReadyCallback { public static final String TAG = "EventDisplayActivity.java" ; public static final String OBJECT_ID = "event_id" ; public static final String DATE = "date" ; public static final String TITLE = "title" ; public static final String LOCATION = "location" ; public static final String ATTENDEES = "attendees" ; public static final String TIME = "time" ; private static final String ATTENDEES_INSTANCE_STATE_KEY = "saved_attendees" ; private static final String EVENT_TITLE_INSTANCE_STATE_KEY = "saved_event_title" ; private static final String DATE_INSTANCE_STATE_KEY = "saved_date" ; private static final String LATLNG_INSTANCE_STATE_KEY = "saved_latlng" ; private double distance ; public String object_id ; public String date ; public String time ; public String title ; private Event displayedEvent ; private ParseObject result ; private TextView eventDisplayTextView ; private TextView eventDisplayDate ; private LinearLayout progressBarLinearLayout ; private String eventTitle ; private String eventLocationName ; public ArrayList < String > attendees ; public ArrayList < String > user_names ; public ArrayList < ParseUser > parse_users ; public ArrayList < ParseGeoPoint > userLocations ; public ArrayList < Double > userDistances ; public ArrayList < Double > init_distances ; private Location finalLocation ; private ParseGeoPoint finalGeoPoint ; private ParseGeoPoint current_location ; private LatLng latLngLocation ; private double latitude ; private double longitude ; private int LOCATION_REFRESH_TIME = 1000 ; private LocationRequest mLocationRequest ; private GoogleApiClient mGoogleApiClient ; private ParseUser currentUser ; private String currentFbId ; private int position ; private boolean mRequestingLocationUpdates ; private ArrayList < ProgressBar > progBarArrayList ; @ Override public void onLocationChanged ( Location location ) { Log . d ( EventDisplayActivity . TAG , "onLocationChanged" ) ; current_location = new ParseGeoPoint ( location . getLatitude ( ) , location . getLongitude ( ) ) ; <START_BUG> if ( ( distance ) == ( - 1.0 ) ) { <END_BUG> distance = current_location . distanceInMilesTo ( finalGeoPoint ) ; init_distances . set ( position , distance ) ; userLocations . set ( position , current_location ) ; userDistances . set ( position , distance ) ; } else { distance = current_location . distanceInMilesTo ( finalGeoPoint ) ; userLocations . set ( position , current_location ) ; userDistances . set ( position , distance ) ; } for ( int i = 0 ; i < ( userDistances . size ( ) ) ; i ++ ) { ProgressBar currentUserBar = progBarArrayList . get ( position ) ; double status = ( userDistances . get ( i ) ) // ( init_distances . get ( i ) ) ; int intStatus = 1 - ( ( ( int ) ( status ) ) * 100 ) ; currentUserBar . setProgress ( intStatus ) ; } displayedEvent . setUserLocations ( userLocations ) ; displayedEvent . setUserDistances ( userDistances ) ; try { displayedEvent . save ( ) ; } catch ( ParseException e ) { } } private void getParseInformation ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } public static Calendar DateToCalendar ( Date date ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override protected void onSaveInstanceState ( Bundle outState ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onMapReady ( GoogleMap googleMap ) { } @ Override public void onConnected ( Bundle bundle ) { } @ Override public void onConnectionSuspended ( int i ) { } @ Override public void onConnectionFailed ( ConnectionResult connectionResult ) { } @ Override protected void onResume ( ) { } private void initLocationTracking ( ) { } @ Override public void onDestroy ( ) { } }

Fix:
if ( ( userDistances . get ( position ) ) == ( - 1.0 ) ) {