INNER CODE UNIT · Java
onReceive
nic-delhi/AarogyaSetu_Android · app/src/main/java/nic/goi/aarogyasetu/GattClient.java:142
public void onReceive(Context context, Intent intent) {
int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.STATE_OFF);
switch (state) {
case BluetoothAdapter.STATE_ON:
startClient();
break;
case BluetoothAdapter.STATE_OFF:
stopClient();
break;
default:
// Do nothing
break;
}
}
};
public void onCreate(Context context, ScanResult result) throws RuntimeException {