title: Android Bluetooth thermal printer connection issue
body: <p>I am facing one strange issue with the Android Bluetooth printer. When I try to connect with the printer device for the first time I am facing the following issue  </p>
  
  <pre><code>BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
  java.io.IOException: read failed, socket might closed or timeout, read ret: -1
      at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:738)
      at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:750)
      at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:375)
  </code></pre>
  
  <p>I am using the following code to connect device with printer</p>
  
  <pre><code>Thread connectThread = new Thread(new Runnable() {
  
              @Override
              public void run() {
                  try {
                      boolean gotuuid = btDevices.getItem(position)
                              .fetchUuidsWithSdp();
                      UUID uuid = btDevices.getItem(position).getUuids()[0]
                              .getUuid();
                      mbtSocket = btDevices.getItem(position)
                              .createRfcommSocketToServiceRecord(uuid);
  
                      mbtSocket.connect();
                  } catch (IOException ex) {
  
                      ex.printStackTrace();
  
                      runOnUiThread(socketErrorRunnable);
                      try {
                          mbtSocket.close();
                      } catch (IOException e) {
                       e.printStackTrace();
                      }
                      mbtSocket = null;
                  } finally {
                      runOnUiThread(new Runnable() {
  
                          @Override
                          public void run() {
                              finish();
  
                          }
                      });
                  }
              }
          });
  
          connectThread.start();
  </code></pre>
  
  <p>Note: Once I try to debug the above block of code it will connect with printer and able to print. Only the issue with the normal mode.</p>
  
  <p>Anyone have any idea with the same issue.</p>