Android BLE BluetoothGattService is null
<p>I use the android app to connecting the BLE device 
 the code</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>   mBluetoothGatt = device.connectGatt(this, false, mGattCallback);

   BluetoothGattService bluetoothservice=mBluetoothGatt.getService(UUID.fromString("0003cdd0-0000-1000-8000-00805f9b0131"));</code></pre>
</div>
</div>
</p>

<p>the result is error:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.bluetooth.BluetoothGattCharacteristic android.bluetooth.BluetoothGattService.getCharacteristic(java.util.UUID)' on a null object reference</p>

<p>because i want get the service by bluetoothgatt not callback(if get service from  mGattCallback is ok)</p>

<p>thanks</p>