Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Inserting elements recursively to List fails in Series 40 6th Edition (Known Issue)

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): All Series 40, 6th Edition devices
CompatibilityArticle
Created: User:Kbwiki (10 Dec 2010)
Last edited: hamishwillee (09 Aug 2013)

Description

Inserting elements recursively (for example by using a for loop) to List by using the method insert(int elementNum, String stringPart, Image imagePart) fails as follows:

  • when the number of elements is less than 12, only one element will be shown on the List;
  • when the number of elements is 12 or more, the List hangs.

How to reproduce

This issue can be reproduced by using this test MIDlet: File:PopulateList.zip

The MIDlet tests a use case where the number of elements is 12.

After launching the MIDlet, press Populate.

On the affected devices, the MIDlet hangs.

Solution

The method insert(int elementNum, String stringPart, Image imagePart) should not be used to populate a List recursively. If a List needs to be recursively populated with elements, using the method append(String stringPart, Image imagePart) is recommended instead for the purpose.

This page was last modified on 9 August 2013, at 05:59.
34 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×