hi.

i have an application that runs ok in the first run but hangs after that. i have a base view that has this code:

switch ( aCommand )
{
/* case EAknSoftkeyBack and EAknCmdExit
are handled by the AppUi class.*/
case EMyStoritCmdPhoneImage:
case EMyStoritCmdPhoneAudio:
case EMyStoritCmdPhoneVideo:
case EMyStoritCmdPhoneTxt:
case EMyStoritCmdPhoneTone:
case EMyStoritCmdPhoneLogo:
case EMyStoritCmdPhonePix:
case EMyStoritCmdPhoneVcard:
{


//iListViewPhone->DynInitMenuPaneL();
AppUi()->HandleCommandL(EPhone);
iListViewPhone->SetFolder(aCommand);
AppUi()->ActivateLocalViewL(iListViewPhone->Id());
break;
}
case EMyStoritCmdStoritImage:
case EMyStoritCmdStoritAudio:
case EMyStoritCmdStoritVideo:
case EMyStoritCmdStoritTxt:
case EMyStoritCmdStoritTone:
case EMyStoritCmdStoritLogo:
case EMyStoritCmdStoritPix:
case EMyStoritCmdStoritVcard:
case EMyStoritCmdFile:
{

if ( iDialog )
{
delete iDialog;
iDialog = NULL;
}

iDialog = CAknMultiLineDataQueryDialog::NewL(iFrom, iTo);
iDialog->ExecuteLD( R_MYSTORIT_RANGE_DIALOG );


TInt iResult = 0;
iResult += iTo;
iResult -= iFrom;

if (iResult >= 31 || iResult < 0)
{
iContainer->ShowGeneralNoteL(R_MYSTORIT_RANGE_ERROR_NOTE,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EErrorTone );
}
else
{
AppUi()->HandleCommandL(EStorit);
iListViewPhone->SetFolder(aCommand);
iListViewPhone->SetRange(iFrom, iTo);
AppUi()->ActivateLocalViewL(iListViewPhone->Id());
}
break;
}
case EAknSoftkeyExit:
{
AppUi()->HandleCommandL(EAknCmdExit);
break;
}
default:
break;
}
}

the program runs ok in the first run for any of the cases. the listview code is a listbox. after performing some operation in the listbox, the base view is activated:

// ----------------------------------------------------------------------------
// void CMyStoritListBoxViewPhone::HandleCommandL( TInt )
// Handles the commands.
// ----------------------------------------------------------------------------
//
void CMyStoritListBoxViewPhone::HandleCommandL( TInt aCommand )
{
TInt total = 0;
TBufC<10> numbuf;
TPtr pnumbuf(numbuf.Des());


switch ( aCommand )
{
/* case EAknSoftkeyBack and EAknCmdExit
are handled by the AppUi class.*/
case EAknSoftkeyBack:
{
iContainer->KillListBoxL();
AppUi()->ActivateLocalViewL(TUid::Uid(1));
break;
}
case EMyStoritCmdGet:
{
total = iContainer->indexArray->Count();


if (total > 0)
{
for (TInt ctr = 0; ctr < total; ctr++)
{
pnumbuf.AppendNum(iContainer->indexArray->At(ctr));
}

if ( iEikonEnv->QueryWinL(_L("Are you sure you want to download the checked titles?"), _L("")) )
{
// Do what you wanna do when "Yes" is selected
iContainer->ShowGeneralNoteL(R_MYSTORIT_CONFIRM_NOTE,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EConfirmationTone,
total, iTariff, _L("downloading"));
AppUi()->ActivateLocalViewL(TUid::Uid(1));
}
else
{
// No was selected
}
}
else
{
iContainer->ShowGeneralNoteL(EMyStoritTotalError,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EErrorTone,
0, 0, _L(""));
}

break;
}
case EMyStoritCmdSend:
{
total = iContainer->indexArray->Count();


if (total > 0)
{
for (TInt ctr = 0; ctr < total; ctr++)
{
pnumbuf.AppendNum(iContainer->indexArray->At(ctr));
}

if ( iEikonEnv->QueryWinL(_L("Are you sure you want to send the checked titles?"), _L("")) )
{
// Do what you wanna do when "Yes" is selected
iContainer->ShowGeneralNoteL(R_MYSTORIT_CONFIRM_NOTE,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EConfirmationTone,
total, iTariff, _L("forwarding"));
AppUi()->ActivateLocalViewL(TUid::Uid(1));
}
else
{
// No was selected
}
}
else
{
iContainer->ShowGeneralNoteL(EMyStoritTotalError,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EErrorTone,
0, 0, _L(""));
}
break;
}
case EMyStoritCmdTitle:
{
total = iContainer->indexArray->Count();

TPtr pnumbuf(numbuf.Des());

for (TInt ctr = 0; ctr < total; ctr++)
{
pnumbuf.AppendNum(iContainer->indexArray->At(ctr));
}

iEikonEnv->InfoMsg(pnumbuf);

if (total == 1)
{
TInt iFileId = iContainer->indexArray->At(0);
iContainer->RenameTitleL(iFileId);
AppUi()->ActivateLocalViewL(TUid::Uid(1));
}
else
{
iContainer->ShowGeneralNoteL(EMyStoritRenameError,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EErrorTone,
0, 0, _L(""));
}
break;
}
case EMyStoritCmdDelete:
{
total = iContainer->indexArray->Count();


if (total > 0)
{
for (TInt ctr = 0; ctr < total; ctr++)
{
pnumbuf.AppendNum(iContainer->indexArray->At(ctr));
}

if ( iEikonEnv->QueryWinL(_L("Are you sure you want to delete the checked titles?"), _L("")) )
{
// Do what you wanna do when "Yes" is selected
iContainer->ShowGeneralNoteL(R_MYSTORIT_CONFIRM_NOTE,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EConfirmationTone,
total, iTariff, _L("deleting"));
AppUi()->ActivateLocalViewL(TUid::Uid(1));
}
else
{
// No was selected
}
}
else
{
iContainer->ShowGeneralNoteL(EMyStoritTotalError,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EErrorTone,
0, 0, _L(""));
}
break;
}
case EMyStoritCmdStore:
{
total = iContainer->indexArray->Count();


if (total > 0)
{
for (TInt ctr = 0; ctr < total; ctr++)
{
pnumbuf.AppendNum(iContainer->indexArray->At(ctr));
}

if ( iEikonEnv->QueryWinL(_L("Are you sure you want to store the checked titles?"), _L("")) )
{
// Do what you wanna do when "Yes" is selected
iContainer->ShowGeneralNoteL(R_MYSTORIT_CONFIRM_NOTE,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EConfirmationTone,
total, iTariff, _L("storing"));
AppUi()->ActivateLocalViewL(TUid::Uid(1));
}
else
{
// No was selected
}
}
else
{
iContainer->ShowGeneralNoteL(EMyStoritTotalError,
CAknNoteDialog::ELongTimeout,
CAknNoteDialog::EErrorTone,
0, 0, _L(""));
}
break;
}
default:
break;
}
}

but when i try to choose any case from the base view, the program hangs. it seems that it hangs after this line:

AppUi()->ActivateLocalViewL(iListViewPhone->Id());

i read somewhere in this forum that the ActivateLocalViewL will call the DoActivate function of the view it wants to activate. i tried inserting this code as the first line to the DoActivate of the list view:

iEikonEnv->InfoMsg(_L("Test"));

i am not able to see this info msg.

thanks.