Hi
Do you have any idea how I should write it ?
I am absoultely stuck and not sure how I should extend the PhoneListner class inside the main
Would you be able to show me the sample ?
Here is the main part of code ( that compiles with still those 2 errors ) that I am using
I have left outthe call listening and part as they are generic
Code:
package com.blackberrydeveloper.ImplCallDiverter;
import net.rim.blackberry.api.phone.*;
public final class ImplCallDiverter implements AbstractPhoneListener extends UiApplication {
static public void main(String[] args)
{
ImplCallDiverter.registerOnStartup();
ImplCallDiverter theApp = new ImplCallDiverter();
theApp.enterEventDispatcher();
}
static private void registerOnStartup()
{
ImplCallDiverter phn_hndl = new ImplCallDiverter();
Phone.addPhoneListener(phn_hndl);
}
Quote:
Originally Posted by samwize
Java cannot extend multiple classes.
I think what you need here is to create another class eg. MainApp and then do what you need in there. When the application is started, main will run.
Code:
public class MainApp extends Application {
private static void main(String[] args) {
......
MyPhone.registerOnStartup();
}
}
|