title: android bluetooth device pair
body: <p>Can any one tell me what's the problem in my code?</p>
  
  <pre><code>startActivityForResult(new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE), DISCOVERY_REQUEST);
  
      @Override
      protected void onActivityResult(int requestCode,int resultCode, Intent data)
      { 
          if (requestCode == DISCOVERY_REQUEST) 
          {
              boolean isDiscoverable = resultCode &gt; 0;
              int discoverableDuration = resultCode;
              if (isDiscoverable) 
              {
                  UUID uuid = UUID.fromString("a60f35f0-b93a-11de-8a39-08002009c666");
                  String name = "bluetoothserver";
                  final BluetoothServerSocket btserver = bt.listenUsingRfcommWithServiceRecord(name, uuid);
                  Thread acceptThread = new Thread(new Runnable() {
                  public void run()
                  {
                      try
                      {
                          BluetoothSocket serverSocket = btserver.accept();
                      }
                      catch (Exception e)
                      {
                          Log.d("BLUETOOTH", e.getMessage());
                      }
                  }
                  });
                  acceptThread.start();
              }
          }
      }
  </code></pre>
  
  <p>In this code it showing error at <strong>onActivityResult</strong>.</p>