Code example for TreeSet

Methods: add, toString

0
   
	private TextView tv, tvs;
	private TreeSet<Float> possibleValues = new TreeSet<Float>();
	private final SensorEventListener ml = new SensorEventListener() {
		public void onSensorChanged(SensorEvent event) { 
			possibleValues.add(event.values[0]); 
			 
			tvs.setText(possibleValues.toString()); 
			tv.setText("light amount = " + event.values[0]); 
	         
	    } 
 
		@Override 
		public void onAccuracyChanged(Sensor sensor, int accuracy) { 
			// TODO Auto-generated method stub 
			 
		} 
	  }; 
	 
	 
	/** Called when the activity is first created. */