Hi,

I'm developing a Names based on the code for Google Contacts. I have
got my application running and can save new names to the sqlite
database.

However, I cannot display records after saving them. The UI displays
"You don't have any contacts to display".

I think it may relate to a "NullPointerException: null" error that I
see in Eclipse.

Has anyone come across this or able to offer some ideas to help me
retrieve/display records after saving them?

Background:

I don't want my Names synchronised with Google's Contacts, so I'm not
using the Contacts API provided by Android. My Names application is to
be a module in a bigger application.

My Names and NamesProvider application in based on source code of the
Contacts and ContactsProvider packages downloaded from the Git
repository at http://android.git.kernel.org/ and changing it to run as
my Names application on the Android emulator.

I have been patching it up using more code from the repository as well
as sticking in empty classes/methods where I think functionality isn't
required (e.g. the telephone functionality). The goal is to make have
this code working before making changes to remove the redundant
functionality from the UI.

So far I have managed to make my Names application load up and display
the "You have no contacts" screen.

I am also able to add contacts and they are successfully stored within
this application's own contacts database. I am then able to see these
records via the sqlite command line.

The problem is that returning to the contacts list displays the "You
don't have any contacts to display" message instead of the newly added
contact. I have checked the database using SQLite and the information
is successfully stored in the correct location.

I currently have a few theories for why this is happening:

1) The res/layout-finger/contacts_list_content.xml file is called by
the code in ContactList. Looking at this file in the layout tab in
Eclipse shows NullPointerException: null. Commenting out the
FocusRequestingListView attribute removes this in place of an "Empty"
screen. However, LogCat never shows a NullPointerException during
execution.

2) My query may not be reaching the database. I have renamed packages
to force it to install on the emulator, so it is possible this is
causing the query to not be received by the database correctly, giving
an empty list of contacts. I don't know where in the Contacts code
this query occurs so I am unable to test it. If possible, could
someone point me in the right direction?

3) The query is structured incorrectly. I have had to change some
constant names to the values themselves as they weren't resolving
properly. It could be that I have renamed a constant incorrectly, but
it is still a valid attribute within the database with an empty field,
causing the query to return empty data.

Personally, I think 1) or 2) are the most likely causes but any help
at all would be massively appreciated.
Thanks in advance
Scott

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to