title: How to get context inside the WebView definition?
body: <p>I want to activate sensor when webview loads a special url so I used <code>sensorManager.registerListener</code> inside the webview definition:</p>
  
  <pre><code>@Override
  public boolean shouldOverrideUrlLoading(WebView view, String url) {
      if (url.contains("compass")){
          sensorManager.registerListener(view.getContext().getApplicationContext(), compass, SensorManager.SENSOR_DELAY_NORMAL);
      }
  }
  </code></pre>
  
  <p>Unfortunately <code>view.getContext().getApplicationContext()</code> is not working. What is the standard way to get the context here?</p>