title: Using proximity sensor in android
body: <p>I want to use proximity sensor in my project. I searched for proximity sensor tutorial. And I found a sensor tutorial at <a href="http://www.vogella.com/articles/AndroidSensor/article.html#sensoroverview_manager" rel="noreferrer">http://www.vogella.com/articles/AndroidSensor/article.html#sensoroverview_manager</a>. I tried to use proximity sensor as following code:</p>
  
  <pre><code>@Override
  public void onSensorChanged(SensorEvent event)
  {
      if(event.sensor.getType() == Sensor.TYPE_PROXIMITY)
      {
          Toast.makeText(getApplicationContext(), "working", Toast.LENGTH_SHORT).show();
      }
  }
  </code></pre>
  
  <p>My <code>Activity</code> is implementing <code>SensorEventListener</code>. But its not working. Do I need to use any permission to use proximity sensor? Or My code is wrong for doing this stuff. Your help will be very appreciated. Thank you</p>