• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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

 
Ranch Hand
Posts: 76
IntelliJ IDE Spring BSD
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?


 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic