Code example for SortedMap

Methods: get, lastKey, remove

0
        float[] d = new float[ 3 ];
        Location.distanceBetween(loc.getLatitudeE6()/1E6, loc.getLongitudeE6()/1E6, 
        		aimPoint.getLatitudeE6()/1E6, aimPoint.getLongitudeE6()/1E6, d);
 
        double distance = FloatMath.sqrt( d[ 0 ] * d[ 0 ] + d[ 1 ] * d[ 1 ] + d[ 2 ] * d[ 2 ] );
        if( distance < disttext.lastKey() && !ad.isShowing() )
        { 	 
        	Log.e("distance", disttext.get( disttext.lastKey() ) );
        	ad.setMessage( disttext.get( disttext.lastKey() ) );  
        	ad.show();
        	 
        	disttext.remove(disttext.lastKey());
        } 
	} 
	 
	public boolean isAimFound() 
	{ 
    	if( aimPoint == null || disttext == null )
    		return false; 
    	 
		return disttext.isEmpty();