我在获取用户拨打号码的时候切换自己程序到前面 只能显示一次,请告诉帮忙,急...
我的程序在BringToForeGround()的时候只能显示一次,但是我打印信息处理可以看到这个函数是每次都执行了,请问是什么原因? 代码如下CTelDial* CTelDial::NewLC()
{
CTelDial* self = new (ELeave) CTelDial;
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CTelDial* CTelDial::NewL()
{
CTelDial* self = CTelDial::NewLC();
CleanupStack::Pop(self);
return self;
}
void CTelDial::ConstructL()
{
CActiveScheduler::Add(this);
itelephony = CTelephony::NewL();
itelephony->NotifyChange(iStatus, CTelephony::EVoiceLineStatusChange, iLineStatusPckg);
SetActive();//invoke the asynchronous function
}
void CTelDial::RunL()
{
if (KErrNone == iStatus.Int())
{
switch (iLineStatus.iStatus)
{
case CTelephony::EStatusDialling:
{
CTestDialAppUi::_pInstance->WriteToTex(_L("EStatusDialling"));
GetDialNumber();
SimulateRedKey();
BringToForeGround();
break;
}
default:
{
break;
}
}
}
itelephony->NotifyChange(iStatus,CTelephony::EVoiceLineStatusChange,iLineStatusPckg);
SetActive(); ///加了StartObserve之后//加上这句返回不显示了
}
void CTelDial::BringToForeGround()
{
TApaTask task(iCoeEnv->WsSession()); ////////////这个是可以带到前台的
task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
task.BringToForeground();
CTestDialAppUi::_pInstance->WriteTimeToTex(_L("33"));
}
补充:移动开发 , Symbian