REDLED.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
byte[] convertedBytes = convertingTobyteArray(
IMM_MID_ALERT1);
BluetoothLeService
.writeCharacteristicNoresponse(
gattCharacteristic,
convertedBytes);
}
});
GREENLED.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
byte[] convertedBytes = convertingTobyteArray(
IMM_MID_ALERT2);
BluetoothLeService
.writeCharacteristicNoresponse(
gattCharacteristic,
convertedBytes);
}
});
TWOLED.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
REDLED.callOnClick();
GREENLED.callOnClick();
}
});
I am doing a project to blink LED.I use two LEDs(RED,GREEN).REDLED button is used to blink Red LED and GREENLED button to blink Green LED.I want to work the two functions simultaneously by clicking TWOLED button. But according to my coding
"REDLED.callOnClick();
GREENLED.callOnClick();"
only GREENLED.callOnClick(); works.
otherwise if I code
"GREENLED.callOnClick();
REDLED.callOnClick();"
only REDLED.callOnClick(); works.
How to make "GREENLED.callOnClick(); and REDLED.callOnClick();work simultaneously when clicking TWOLED button.