When using CAknEnumeratedTextPopupSettingItem dynamically at runtime, “Setting Item Lis 6″ panic may be encountered occasionally. If the initial value you set when constructing this kind of setting item cannot be found in its enumerated text array, this panic will occur definitely.
In the article “Use CAknEnumeratedTextPopupSettingItem dynamically at runtime” in Forum Nokia wiki, I had described this issue and given a solution — using the first item as default value if no match found. The related code snippet are listed here, and please read that article for more.
void CMyTextPopupSettingItem::LoadL() { CArrayPtr* texts = this->EnumeratedTextArray(); TInt selectedIndex = this->IndexFromValue(iValue); if (selectedIndex < 0) // no match found. { if (texts->Count() > 0) { // choose the first item as default one. CAknEnumeratedText* item = texts->At(0); // reset external value to the default one. this->SetExternalValue(item->EnumerationValue()); } } CAknEnumeratedTextPopupSettingItem::LoadL(); }