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.

Archived:Item.getLabel() Method returns incorrect value on S60 1st Edition (Known Issue)

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Compatibility
Platform(s):
S60 1st Edition
Article
Created: User:Technical writer 1 (23 Mar 2004)
Last edited: hamishwillee (16 Aug 2013)

Contents

Overview

The Item.getLabel() method doesn't seem to return the correct value for a ChoiceGroup's Label.

Symptoms

The Item.getLabel() method may return a null value, which results in NullPointerException.

Description

There is a known issue in setting the label in ChoiceGroup constructor. A ChoiceGroup (direct subclass of Item) is created as follows:

cg = new ChoiceGroup("ChoiceGroup", ChoiceGroup.EXCLUSIVE, stringOptions, null);

and if the label is queried as follows:

System.out.println("Label: "+cg.getLabel());

</code>

The result is "Label: null." However, the "ChoiceGroup" label is properly visible on the screen.

Solution

If the label is set by using the Item.setLabel() method instead of just using the ChoiceGroup constructor, also the Item.getLabel() method returns the correct result.

This page was last modified on 16 August 2013, at 03:43.
44 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.

×