Archived:New line cannot be inserted with '\n' char in Alert using Java ME before S60 3rd Edition FP2 (Known Issue)
Archived: 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.
The article is believed to be still valid for the original topic scope.
Article Metadata
Tested with
Devices(s): S60 3rd Edition, S60 3rd Edition, FP1 devices
Compatibility
Platform(s): S60 3rd Edition, S60 3rd Edition, FP1
Article
Keywords: javax.microedition.lcdui.Alert
Created: User:Technical writer 1
(10 Dec 2008)
Last edited: hamishwillee
(28 Jun 2012)
Contents |
Overview
A new line cannot be inserted with the '\n' character in Alerts using Java ME in older S60 Editions.
Description
For text strings in Java ME, a new line can be inserted using the line feed character '\n'.
With S60 Editions up till S60 3rd Edition, Feature Pack 1, the new line is, however, not inserted properly.
How to reproduce
This issue can be tested with a MIDlet using the following code:
Alert al;
//..
al = new Alert("Hello World Alert!");
al.setString("New\nline"); // this should print text 'line' to next line
Display.getDisplay(this).setCurrent(al);
//..
For the affected devices and S60 Editions, the string will be printed as 'New line' on the same line instead of printing the words 'New' and 'line' on separate lines.
Solution
This issue has been fixed starting from S60 3rd Edition, Feature Pack 2.


(no comments yet)