i am getting all contacts from contact database.
when i click center button then i get all details of that contact..
i have used CPbkContactEditorDlg to get all details..but problem is it display details in edit mode..
i dont want to edit any contact details..just want to show...
how i can show details without edit...
following code i am using to display details..
TInt currentItemIndex( iListBox->CurrentItemIndex() );
TContactItemId itemId=currentItemIndex;
CPbkContactEngine* pbkContactEng =
CPbkContactEngine::NewL(&iCoeEnv->FsSession());
CleanupStack::PushL( pbkContactEng );
// load the contacts dialog resources
CCoeEnv *env = CEikonEnv::Static();
RPbkViewResourceFile pbkRes( *env );
pbkRes.OpenL();
CPbkContactItem* aContactItem = pbkContactEng->OpenContactL( itemId );
CleanupStack::PushL( aContactItem );
// Open the contacts dialog
// third parameter: set to true if aContactItem is a
// new contact (not yet in the database)
// fourth parameter index of field to focus initially
// fifth paramter if true sets the contact initially as "edited".
CPbkContactEditorDlg* pbkContactDlg =
CPbkContactEditorDlg::NewL( *pbkContactEng,
*aContactItem,
EFalse, -1,
EFalse );
CleanupStack::PushL( pbkContactDlg );
pbkContactDlg->SetMopParent( iAvkonAppUi );
TInt res( KErrNone );
TRAPD( err, res = pbkContactDlg->ExecuteLD() );
pbkRes.Close();
pbkContactEng->CloseContactL( aContactItem->Id() );
CleanupStack::Pop( pbkContactDlg );
CleanupStack::PopAndDestroy( 2 ); //aContactItem, pbkContactEng

Reply With Quote




