Namespaces
Variants
Actions

Value of TextField.NUMERIC is limited to 10 digits in Series 40 (Known Issue)

Jump to: navigation, search
Article Metadata

Tested with
Devices(s): All Series 40 devices

Compatibility
Platform(s): All Series 40 Editions

Article
Created: User:Technical writer 1 (April 2, 2008, updated April 16, 2008)
Last edited: hamishwillee (05 Jul 2012)

Contents

Overview

In Series 40, the value of TextField.NUMERIC must not exceed the value of 2147483646 (Integer.MAX_VALUE-1), otherwise an IllegalArgumentException is thrown.

Description

The integer value inserted in TextField defined with the TextField.NUMERIC constraint must not exceed the value of 2147483646 (i.e. Integer.MAX_VALUE-1) in Series 40, otherwise an IllegalArgumentException is thrown. In S60, this value may be exceeded without the exception.

How to reproduce

Use, for example, the following piece of code to reproduce this issue:

   TextField textField = new TextField("Enter Number:", "", 10, TextField.NUMERIC);
long n = Integer.MAX_VALUE;
textField.setString(Long.toString(n));
System.out.println("OK for Integer.MAX_VALUE, i.e. " + n);
try {
textField.setString(Long.toString(++n));
}
catch (IllegalArgumentException e) {
System.out.println("FAILED for Integer.MAX_VALUE + 1, i.e. " + n);
}


Solution

Avoid using values starting from Integer.MAX_VALUE and higher with the TextField.NUMERIC constraint in Series 40.

This page was last modified on 5 July 2012, at 09:22.
89 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved