SensorManager unregisterListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SensorManager unregisterListener method.

This code example shows how to use the following methods:unregisterListener
		 
	} 
	 
	public void stop() 
	{ 
		this.sensorManager.unregisterListener(this);
	} 
	 
	public void onAccuracyChanged(Sensor sensor, int accuracy) {
		// TODO Auto-generated method stub 
		 
	} 
 
	public void onSensorChanged(SensorEvent event) {
		// We want to know what temp this is. 
		float temp = event.values[0];
		mAppView.loadUrl("javascript:gotTemp(" + temp + ")");
	} 
 
} 
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:unregisterListener
		 
	} 
	 
	public void stop() 
	{ 
		this.sensorManager.unregisterListener(this);
	} 
	 
	public void onAccuracyChanged(Sensor sensor, int accuracy) {
		// TODO Auto-generated method stub 
		 
	} 
 
 
	public void onSensorChanged(SensorEvent event) {
		// We only care about the orientation as far as it refers to Magnetic North 
		float heading = event.values[0];
		mAppView.loadUrl("javascript:gotBearing(" + heading + ")");
	} 
} 
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:unregisterListener
	} 
	 
	public void stop() 
	{ 
		if(started)
			sensorManager.unregisterListener(this);
	} 
	 
	 
 
	public void onAccuracyChanged(Sensor sensor, int accuracy) {
		// TODO Auto-generated method stub 
		 
	} 
 
	public void onSensorChanged(SensorEvent event) {		
		if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)
			return; 
		long curTime = System.currentTimeMillis();
		if (lastUpdate == -1 || (curTime - lastUpdate) > mTime) {		
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:unregisterListener
                          mgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
                          SensorManager.SENSOR_DELAY_UI);
  } 
   
  public void close() { 
    mgr.unregisterListener(listener);
  } 
   
  private void isShaking() { 
    long now=SystemClock.uptimeMillis();
     
    if (lastShakeTimestamp==0) {
      lastShakeTimestamp=now;
       
      if (cb!=null) {
        cb.shakingStarted();
      } 
    } 
    else { 
      lastShakeTimestamp=now;
9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getDefaultSensor, registerListener, unregisterListener
This code example shows how to use the following methods:getDefaultSensor, registerListener, unregisterListener
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:registerListener, unregisterListener
    super.onPause(); 
  } 
 
  @Override 
  public void onListItemClick(ListView l, View v, int position, long id) {
    mgr.unregisterListener(this);
    mgr.registerListener(this, adapter.getItem(position),
                         SensorManager.SENSOR_DELAY_NORMAL);
  } 
 
  @Override 
  public void onAccuracyChanged(Sensor sensor, int accuracy) {
    // TODO Auto-generated method stub 
  } 
 
  @Override 
  public void onSensorChanged(SensorEvent event) {
    mgr.unregisterListener(this);
 
    Toast.makeText(getActivity(),
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:unregisterListener
		    this.mSensorManager.registerListener(this, this.mAccelerometer, (int)(interval*100000));
		} 
	} 
       
	public void disable() { 
		this.mSensorManager.unregisterListener(this);
	} 
 
	// =========================================================== 
	// Methods for/from SuperClass/Interfaces 
	// =========================================================== 
 
	@Override 
	public void onSensorChanged(final SensorEvent pSensorEvent) {
		if (pSensorEvent.sensor.getType() != Sensor.TYPE_ACCELEROMETER) {
			return; 
		} 
 
		float x = pSensorEvent.values[0];
		float y = pSensorEvent.values[1];
9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:unregisterListener
  } 
 
  void stop() { 
    if (lightSensor != null) {
      SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
      sensorManager.unregisterListener(this);
      cameraManager = null;
      lightSensor = null;
    } 
  } 
 
  @Override 
  public void onSensorChanged(SensorEvent sensorEvent) {
    float ambientLightLux = sensorEvent.values[0];
    if (cameraManager != null) {
      if (ambientLightLux <= TOO_DARK_LUX) {
        cameraManager.setTorch(true);
      } else if (ambientLightLux >= BRIGHT_ENOUGH_LUX) {
        cameraManager.setTorch(false);
      } 
9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getDefaultSensor, registerListener, unregisterListener
 
		SensorManager sensorManager = (SensorManager)
				context.getSystemService(Context.SENSOR_SERVICE);
 
		if (gameKeyListener != null)
			sensorManager.unregisterListener(this);
 
		gameKeyListener = l;
		if (gameKeyListener != null) {
			Sensor sensor = sensorManager.getDefaultSensor(
					Sensor.TYPE_ORIENTATION);
			sensorManager.registerListener(this,
					sensor, SensorManager.SENSOR_DELAY_GAME);
		} 
	} 
 
	public void onAccuracyChanged(Sensor sensor, int accuracy) {
	} 
 
	public void onSensorChanged(SensorEvent event) {
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related SensorManager unregisterListener Questions & Answers:

Other SensorManager unregisterListener Examples

57:	    super.onDestroy();
58:	    if (sensor != null) {
59:	      sensorService.unregisterListener(mySensorEventListener);
60:	    }
61:	  }

Read More

unregisterListener Method Overview
This method was deprecated in API level 3. This method is deprecated, use unregisterListener(SensorEventListener) instead.
See Code Examples for other Android SensorManager Methods: