• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Obtaining the arrayList from Sqlite database

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to obtain the ArrayList of Integers from database to be used with the activity containing the Chart (mChartEngine). When the Chart activity (OnCreate) is initiated the code looks for the method happyDataFromDb. It's main purpose should be to obtain the integers from the happinessDb (SQLite database) and store it in an array called happyList in Char activity.

after I try to run the activity i get an error leading to the addHappyData which is initiated for drawing the chart specifically in for loop.

help would be much appreciated!

brg

HappinesDB:




Chart Activity:

 
Lovro Bajc
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

finally have come to solution. Minor changes and it works fine. I believe also that there can be other ways to do it in order to be more efficient.

here are the modifications:

happinessDb class modifications:



and in Chart class:

 
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic