Go Back   Android Forums > Android Discussion > Android Applications
Android Applications All the information you could ever want about Android Applications. Learn about apps and get help with them... all here! New apps can be found and announced in the Applications Announcements forum linked below.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
LinkBack Thread Tools
Old December 17th, 2010, 05:52 AM   #1 (permalink)
New Member
Thread Author (OP)
Join Date: Mar 2010
Posts: 2
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Question Getting null Cursor from DBAdapter inspite of record being there in table.

Hello All,

In my android application i have created a class to handle sqlite database & table.
In that i have created one function which returns all the records in the table.

Below is the code i m using

Cursor result=null;result = db.query(DATABASE_TABLE1, new String[]{KEY_ID,KEY_UID,KEY_TICKETID},null, null, null, null, null);

return result;

inspite of records being there i m getting a empty cursor.

But if i write

System.out.println("getAllItemsCursor(), " + result.getCount());

before return result statement i m getting the records properly i.e. non-empty cursor.

Can anybody guide me where i m making a mistake.

rraiyarela is offline  
Reply With Quote
sponsored links
android1.6, cursor, dbadapter, null

Go Back   Android Forums > Android Discussion > Android Applications
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -5. The time now is 04:19 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.