Hi All,

I have created a VOIP application in which i have to select recent dialed calls or received call from log. When i select the any number, number get selected and appeares to application home screen.
But after this application got crashed.
Here is the code please suggest me if i am doing any thing wrong.

Thanks.

=========================================================================================================
TBool CMobileDialerCallHistoryView::HandleControlPaneLeftSoftKeyPressedL( TInt aCommand )
{

CAknSingleStyleListBox* iListBox = new(ELeave) CAknSingleStyleListBox;
iListBox = (CAknSingleStyleListBox*)iMobileDialerCallHistory->ComponentControl(0);
TInt Count = iListBox->Model()->ItemTextArray()->MdcaCount();

if(iListBox->Model()->NumberOfItems()==0)
{
CAknInformationNote* note = new ( ELeave ) CAknInformationNote();
HBufC* noteText ;

TBufC<50> note1(_L("No Item Found"));
noteText = note1.AllocL();
note->ExecuteLD( *noteText );
}
else
{
CTextListBoxModel* model = iListBox->Model();
CDesCArray* desArray = STATIC_CAST(CDesCArray*, model->ItemTextArray());
CleanupStack::PushL(desArray);
TInt index = iListBox->CurrentItemIndex();
TInt desArraySize = desArray->MdcaCount() -1;
for(TInt i=0 ;i<=desArraySize ;i++)
{
if(index == i)
{
HBufC* item = HBufC::NewLC(30);
item = (HBufC*)(*desArray)[i].AllocLC();
const TUid KCustomMessageUid= {2};
TBuf<100> name ;
_LIT ( KStringHeader, "%S" );
name.Format(KStringHeader , item);
name.Trim();
HBufC8* items = CnvUtfConverter::ConvertFromUnicodeToUtf8L(name);
AppUi()->ActivateLocalViewL(TUid::Uid(EMobileDialerContainerViewId),
KCustomMessageUid ,*items );
}
}
CleanupStack::Pop();
}
return EFalse;
}
=========================================================================================================