what is whrong in this code snipet?
Code:
public void registerOnStartup() {
Incomins_Call_Block phone_handler = new Incomins_Call_Block();
Phone.addPhoneListener(phone_handler);
}
public void deRegisterOnEnd() {
Phone.removePhoneListener(phone_handler);
} i get the following error when i compile the code for text in red
"cannot find symbol"
Code:
Incomins_Call_Block phone_handler = new Incomins_Call_Block();
public void registerOnStartup() {
Phone.addPhoneListener(phone_handler);
}
public void deRegisterOnEnd() {
Phone.removePhoneListener(phone_handler);
} and for this snipet i get a exception"net.rim.vm.StackOverflowError"
i tried doing it this also :
Code:
public void registerOnStartup(int i) {
Incomins_Call_Block phone_handler = new Incomins_Call_Block();
if(i == 1) {
Phone.addPhoneListener(phone_handler);
}
else {
// Dialog.alert(" bye bye ");
Phone.removePhoneListener(phone_handler);
phone_handler = null;
System.exit(0);
}
} but when i pass i=0....the listener does noyget removed.
can someone help.
thanks
Meenal