Android: Monitoring Bluetooth Discovery - what does this compile error mean?
<p>I'm learning Bluetooth programming on Android using the Wrox <em>Professional Android 2 Application Development</em> book.  The discovery monitor example (pg 432) has this code snippet:</p>

<pre><code>    BroadcastReceiver discoveryMonitor = new BroadcastReceiver() {

          String dStarted = BluetoothAdapter.ACTION_DISCOVERY_STARTED;
          String dFinished = BluetoothAdapter.ACTION_DISCOVERY_FINISHED;

          @Override
          public void onReceive(Context context, Intent intent) {
            if (dStarted.equals(intent.getAction())) { 
              // Discovery has started.
              Toast.makeText(getApplicationContext(),
                             "Discovery Started...", Toast.LENGTH_SHORT).show();
            }
            else if (dFinished.equals(intent.getAction())) {
              // Discovery has completed.
              Toast.makeText(getApplicationContext(),
                             "Discovery Completed...", Toast.LENGTH_SHORT).show();
            }
          }      
        };
        registerReceiver(discoveryMonitor, 
                         new IntentFilter(dStarted));
        registerReceiver(discoveryMonitor, 
                         new IntentFilter(dFinished));
</code></pre>

<p>... and on each of the two registerReceiver calls at the end I get . . .</p>

<p><strong>Syntax error on tokens, AnnotationName expected instead<br>
Syntax error, insert "Type VariableDeclaratorId" to complete FormalParameterList</strong></p>

<p>What's an annotationName and what's going wrong here?</p>

<p>Thanks in advance!!</p>
