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
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

SystemListener same declaration as SystemListener2?

Hay,

I am trying to implement the SystemListener2 like this:

 

public final class TestApp extends UiApplication implements SystemListener{ (...)

...

this.addSystemListener2(this);

and then use it like this:

 

public void backlightStateChange(boolean on){ } //Invoked when the backlight state changes.

 

public void cradleMismatch(boolean mismatch){ } //Invoked when a USB device has been placed in a serial cradle.

 

public void fastReset(){ } //Invoked when a fast reset occurs.

 

public void powerOffRequested(int reason){ } // Invoked when the OS requests that the device power be turned off.

 

public void usbConnectionStateChange(int state){ } //Invoked when the USB connection state changes.

 

 But somehow the SystemListener2 is not defined the same way as the SystemListener. Where is the difference in the declaration?

 

Thank you in advance for any help!

 

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: SystemListener same declaration as SystemListener2?

Change your class declaration to "implements SystemListener2"

 

Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: SystemListener same declaration as SystemListener2?

Yes, I changed that but now the compilor still gives me this error:

 

TestApp is not abstract and does not override abstract method batteryStatusChange(int) in net.rim.device.api.system.SystemListener

 

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Highlighted
Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: SystemListener same declaration as SystemListener2?

the error-message means you don't implement all methods of the interface (and you have to).
----------------------------------------------------------
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