Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. try {
  2. Method m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] { int.class });
  3. temp = (BluetoothSocket) m.invoke(mmDevice, 1);
  4. } catch (Exception e) {
  5. }
  6.  
  7. // Register for broadcasts when a device is discovered
  8. IntentFilter intentFilter = new IntentFilter();
  9. intentFilter.addAction(BluetoothDevice.ACTION_FOUND);
  10. intentFilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
  11. intentFilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
  12. registerReceiver(mReceiver, intentFilter);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement