Hi Sunnan
Do you mean I should implement something like
Code:
public final class QuitCall extends AbstractPhoneListener {
static public void main(String[] args)
{
QuitCall.registerOnStartup();
}
static private void registerOnStartup()
{
QuitCall phone_handler = new QuitCall();
Phone.addPhoneListener(phone_handler);
}
private QuitCall(){}
private void checkCall(String ehandler, int callid)
{
PhoneCall callInfo = Phone.getCall(callid);
if ( callInfo != null ) {
/*
* Event Handler: ehandler
* Telephone No.: callInfo.getDisplayPhoneNumber();
* Elapsed Time : callInfo.getElapsedTime();
* Call Status : callInfo.getStatusString();
*/
}
}
// A call has been added to a conference call
public void callAdded(int callId) { checkCall("callAdded", callId); }
// User answered a call
// New call has arrived
public void callIncoming(int callId)
{ checkCall("callIncoming", callId); }
// Outbound call initiated by the handheld
public void callInitiated(int callid)
{
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
Status.show( " An Outgoing call hs been made ");
}
});
checkCall("callInitiated", callid);
}
Also I dont think my Listener is working properly
Do you know what could be the reason ?
Quote:
Originally Posted by sunnan
i cant get you clearly....if your application runs in background and if u want to display phonenumber during incoming call just implement this code in abstract method
Code:
PhoneCall callInfo = Phone.getActiveCall();
if ( callInfo != null )
{
Telephone = callInfo.getDisplayPhoneNumber();
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
Status.show("incoming from: "+Telephone);
}
});
|