Run this on the simulator, play with the Simulate -> Network Properties RSSI, turn the radio on and off. Works for me...
Code:
package rsl;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.component.AutoTextEditField;
import net.rim.device.api.system.RadioStatusListener;
/**
*
*/
class MyRadioStatusListener extends UiApplication implements RadioStatusListener {
private MainScreen mainScreen;
private AutoTextEditField text;
public static void main(String[] args) {
MyRadioStatusListener rsl = new MyRadioStatusListener();
rsl.pushScreen(rsl.mainScreen);
rsl.enterEventDispatcher();
}
MyRadioStatusListener() {
mainScreen = new MainScreen();
mainScreen.setTitle("RadioStatusListener");
text = new AutoTextEditField();
text.setText("Output:\n");
mainScreen.add(text);
addRadioListener(this);
}
public void baseStationChange() {
}
public void networkScanComplete(boolean status) {
text.setText(text.getText() + "networkScanComplete " + status + "\n");
}
public void networkServiceChange(int networkId, int service) {
}
public void networkStarted(int networkId, int service) {
}
public void networkStateChange(int state) {
}
public void pdpStateChange(int apn, int state, int cause) {
}
public void radioTurnedOff() {
text.setText(text.getText() + "radioOff\n");
}
public void signalLevel(int level) {
text.setText(text.getText() + "signalLevel " + Integer.toString(level) + "\n");
}
}