hi,
I have created list box with two items in it.Now on opening the first item i need another list with two or more items.But on opening the first item the application is getting closed.Please help..???
Here is my code..
/*****appview****/
CreateWindowL();
iListBox = new (ELeave) CAknDoubleGraphicStyleListBox;
iListBox->ConstructL(this, EAknListBoxSelectionList);
iListBox->SetContainerWindowL(*this);
iListBox->ActivateL();
iListBox->CreateScrollBarFrameL(ETrue);
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto);
FillListBoxL();
iListBox->DrawNow();
SetRect( aRect );
ActivateL();
void CHelloWorldVarunAppView::FillListBoxL()
{
_LIT(KItemTextDouble1, "0\tFirst item\tHello");
_LIT(KItemTextDouble2, "1\tSecond item\thello1");
CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(2);
CleanupStack::PushL(array);
array->AppendL(KItemTextDouble1);
array->AppendL(KItemTextDouble2);
CleanupStack::Pop();
iListBox->Model()->SetItemTextArray(array);
CArrayPtr<CGulIcon>* iconArray = new (ELeave) CArrayPtrFlat<CGulIcon>(2);
CleanupStack::PushL(iconArray);
_LIT(KIconFile,"c:\\ImagePlugin.MBM");
iconArray->AppendL( iEikonEnv->CreateIconL( KIconFile,0,1) );
iconArray->AppendL( iEikonEnv->CreateIconL( KIconFile,6,7) );
iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray);
CleanupStack::Pop();
iListBox->HandleItemAdditionL();
/****Appui****/
case EHelloWorldVarunCommand3:
{
if(iAppView -> CurrentItemIndex1()==0)
{
iAppView -> FillListBox0L();
//iAppView->iListBox->DrawNow();
}
else if(iAppView -> CurrentItemIndex1()==1)
{
iAppView -> FillListBox1L();
//iAppView->iListBox->DrawNow();
}
/*********AppView*******/
void CHelloWorldVarunAppView::FillListBox0L()
{
iListBox->Reset();
_LIT(KItemTextDouble3, "3\tThird item\tBox");
_LIT(KItemTextDouble4, "4\tFourth item\tBox1");
CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(2);
CleanupStack::PushL(array);
array->AppendL(KItemTextDouble3);
array->AppendL(KItemTextDouble4);
CleanupStack::Pop();
iListBox->Model()->SetItemTextArray(array);
iListBox->HandleItemAdditionL();
iListBox->DrawNow();
}
void CHelloWorldVarunAppView::FillListBox1L()
{
_LIT(KItemTextDouble5, "5\tFifth item\tBox3");
_LIT(KItemTextDouble6, "6\tSixth item\tBox4");
CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(2);
CleanupStack::PushL(array);
array->AppendL(KItemTextDouble5);
array->AppendL(KItemTextDouble6);
CleanupStack::Pop();
iListBox->Model()->SetItemTextArray(array);
iListBox->HandleItemAdditionL();
iListBox->DrawNow();
}
TInt CHelloWorldVarunAppView::CurrentItemIndex1()
{
TInt i = iListBox->CurrentItemIndex();
return i;
}




