Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 22
Registered: ‎06-16-2010
My Device: Z10
My Carrier: Rogers

LED state pattern

Hi there,

I have an applicion that needs to blink the LED continuously (and in and in a pattern if possible) until the application itself closes.

 

After searching for examples I have the following example;

int pattern[] = {
        Color.RED, 80, 50,
        Color.GREEN, 80, 50,
        Color.BLUE, 80, 50,
        Color.BLACK, 80, 300};


        if (LED.isPolychromatic(LED.LED_TYPE_STATUS)){
            LED.setColorPattern(pattern,true);
            LED.setState(LED.STATE_BLINKING);
        }

 

Unfortunately when an e-mail arrives the blackberry reverts back to the default red blinking.  In a previous post I noted that there is no way to override the default.  I am thinking about removing the last line [LED.setState(LED.STATE_BLINKING);] and putting the rest into a timer that runs every 3+ seconds.

 

Is there another (hopefully better) way to accomplish this?

 

Thanks in advance!

Highlighted
Developer
Posts: 16,999
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: LED state pattern

i think you are correct when you state that you cannot change the default behavior, so using a timer would be your best bet.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter