File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BlackBerry and the fly likes Unable to display numerical data in for loop, using BlackBerry SDK 4.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » BlackBerry
Bookmark "Unable to display numerical data in for loop, using BlackBerry SDK 4.5" Watch "Unable to display numerical data in for loop, using BlackBerry SDK 4.5" New topic
Author

Unable to display numerical data in for loop, using BlackBerry SDK 4.5

Chris Creed
Ranch Hand

Joined: Feb 27, 2009
Posts: 67

Hello all

After beating my head on this for all morning, I appeal to the community for some help.

First the code in question, I have a setup that creates a new screen, and calls a class to show a new string every second, like so:



As you can see, it takes the literal String in mainScreen.appendLabelText, and sends it to this function in the file that called MainScreenUpdaterThread.



However, I would like to use the number contained in the variable i in the for loop, instead of a literal string. However, when I do so, I get the following error at the i variable in the mainScreen.appendLabelText():

Cannot refer to a non-final variable i inside an inner class defined in a different method


I've tried casting the integer in i to String with no success, and an array to the same thing. Is there just soemthing silly that I've missed here that could be affecting it?


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to display numerical data in for loop, using BlackBerry SDK 4.5
 
Similar Threads
Why Blackberry Simulator run so slow for HelloWorld App.
calling web services in blackberry
Cursor object not returning data properly.
Dealing with dates and Zulu time...
Java Tetris