• Post Reply Bookmark Topic Watch Topic
  • New Topic

Obtaining the arrayList from Sqlite database

 
Lovro Bajc
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • 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
  • 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:

 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!