Forums Register Login

populating expandablelistview from sqlite database application force closes

+Pie Number of slices to send: Send
I am using the tutorial on AndroidHive for expandablelistview and i want to populate it from a sqlite table.
MainActivity.java


my datamanager



The application force closes .Can anyone check whether i have used the sql in rawquery properly.Please help.
+Pie Number of slices to send: Send
Post the full stack trace from the logcat output. Examining that should always be your first step in debugging a forced app close.
+Pie Number of slices to send: Send
A force close can happen for too many reasons to start guessing. You need to view the LogCat output and see what the error is so you know what the problem is and where it occurs.


Using DDMS from Eclipse (or other IDE): http://developer.android.com/tools/debugging/ddms.html
Using adt to view LogCat: http://developer.android.com/tools/debugging/debugging-log.html
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
Isn't that nice how it points directly not only at the line of code *where* the errors occurs, but even gives you clues *what* the problem is :-)

So, the problem is with your SQL statement - is CATEGORY a varchar of some kind? If so, how to do you need to handle varchar literal values in SQL statements?
+Pie Number of slices to send: Send
Will this work??

+Pie Number of slices to send: Send
The above ran without force closing.But i don't see any data when i click the Expandable list view Please help...
+Pie Number of slices to send: Send
The word Entertainment was actually entertainment in the table but still it doesnt work...
+Pie Number of slices to send: Send
 

achuthan mukundarajan wrote:The word Entertainment was actually entertainment in the table but still it doesnt work...


Now you have to figure out why it doesn't work. What lines of code get executed? What happens if you put data in the list without using the database? What data is returned from your database query? This is where adding your own log lines, and/or running the application in debug
mode with break points can help you figure out exactly what is happening with your execution.
I'm full of tinier men! And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 11260 times.
Similar Threads
Problem with equals on collection
put in LIST Sample Data to debug, also how view SQLITE DB Data from Eclipse IDE for debug purposes
Problem in my application
IllegalStateException on LinearLayout.addView(View view) method call
ListView duplicate everything
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:21:31.