知道一条信息的TMsvId,想打开信息浏览视图,主要用如下代码实现:
系统的SMS ViewID:(TVwsViewId(KPhoneSMSUid, KPhoneSMSViewUid))
void CMtmEngine::OpenMessage(TMsvId aId) { TMsvEntry msgEntry; // class that represents the entry (a local cache) TMsvId ownerServiceId; if( iSession->GetEntry( aId,ownerServiceId, msgEntry ) != KErrNone ) return; CClientMtmRegistry *cltReg = CClientMtmRegistry::NewL( *iSession ); CleanupStack::PushL( cltReg ); CBaseMtm *mtm = cltReg->NewMtmL( msgEntry.iMtm ); CleanupStack::PushL( mtm ); CMtmUiRegistry *reg = CMtmUiRegistry::NewL( *iSession ); CleanupStack::PushL( reg ); CBaseMtmUi *ui = reg->NewMtmUiL( *mtm ); CleanupStack::PushL( ui ); mtm->SwitchCurrentEntryL( msgEntry.Id() ); //Editor are embedded. ui->SetPreferences( EMtmUiFlagEditorPreferEmbedded ); CMsvOperationActiveSchedulerWait *waiter = CMsvOperationActiveSchedulerWait::NewLC(); CMsvOperation* op = ui->ViewL( waiter->iStatus ); waiter->Start(); delete op; CleanupStack::PopAndDestroy( 5, cltReg ); }