This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
You have now jumped from a standard Java question (accessing from an ArrayList) back into a new Android-specific question. Generally for each new question you should create a new thread, and put it in the proper location, so folks expecting Java questions don't see Android questions without context.
Here is my guess: or more of leading questions. What do you put INTO the database in the COL_PRODUCT_NAME? Can you show the insert statement? What type do you define the column? Did you change your database so it stopped holding ... oh let's say String and started holding Integers? When you did that did you remember to increment the database version and write a correct update method?
Joined: Jul 12, 2013
I want to get an array list which contains the identifiant of all the product for each category,
here's the code:
COL_ID_PRODUCT: (type int) column which contains the identifiant for each product
TABLE_PRODUCT:contains COL_ID_PRODUCT,COL_PRODUCT_NAME which contains the name for each product, COL_CATEGORY (type int) contains the ID of the category to which each product belongs.
To test my method, i just want to calculate the size of this tab :
When i debug this, the size n is 0 or i have 7 product in the category with ID=1 !!
Joined: Jul 12, 2013
Nobody can help me
Joined: Mar 22, 2005
That's probably because you're ignoring most of what people tell you. You didn't follow up on most of what Jesper and Steve suggested.
I have sort of the same problem. I need to obtain the data in Chart Activity from the database class and use it to populate chart. Since it is dynamic chart I created an ArrayList of Integers, however how to populate it with integers from database class I have no idea.
so far I have come up with a method in Chart calss:
Class getHappyData in the database should return the integers ArrayList HappyList. And here I have an issue how to obtain the integers and put them into HappyList in Chart.class.