/android/export-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/export-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/exportcontacts/ContactsBackend.java

  • Committer: edam
  • Date: 2013-01-06 18:11:57 UTC
  • Revision ID: tim@ed.am-20130106181157-ojglab4ju9je9ndr
stop using managedQuery(), which isn't cleaning up my queries

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
                if( _cur == null )
94
94
                {
95
95
                        // get all contacts
96
 
                        _cur = _activity.managedQuery( Contacts.People.CONTENT_URI,
 
96
                        _cur = _activity.getContentResolver().query(
 
97
                                Contacts.People.CONTENT_URI,
97
98
                                new String[] {
98
99
                                        Contacts.People._ID,
99
100
                                        Contacts.People.NAME,
102
103
                }
103
104
 
104
105
                // if there are no more contacts, abort
105
 
                if( _cur == null || !_cur.moveToNext() ) {
 
106
                if( _cur == null ) return false;
 
107
                if( !_cur.moveToNext() ) {
 
108
                        _cur.close();
106
109
                        _cur = null;
107
110
                        return false;
108
111
                }
121
124
                        contact.addNote( note );
122
125
 
123
126
                // add the organisations
124
 
                Cursor cur = _activity.managedQuery( Contacts.Organizations.CONTENT_URI,
 
127
                Cursor cur = _activity.getContentResolver().query(
 
128
                        Contacts.Organizations.CONTENT_URI,
125
129
                        new String[] {
126
130
                                Contacts.Organizations.COMPANY,
127
131
                                Contacts.Organizations.TITLE,
138
142
                cur.close();
139
143
 
140
144
                // add the phone numbers
141
 
                cur = _activity.managedQuery( Contacts.Phones.CONTENT_URI,
 
145
                cur = _activity.getContentResolver().query(
 
146
                        Contacts.Phones.CONTENT_URI,
142
147
                        new String[] {
143
148
                                Contacts.Phones.NUMBER,
144
149
                                Contacts.Phones.TYPE,
155
160
                cur.close();
156
161
 
157
162
                // add the email and postal addresses
158
 
                cur = _activity.managedQuery( Contacts.ContactMethods.CONTENT_URI,
 
163
                cur = _activity.getContentResolver().query(
 
164
                        Contacts.ContactMethods.CONTENT_URI,
159
165
                        new String[] {
160
166
                                Contacts.ContactMethods.KIND,
161
167
                                Contacts.ContactMethods.TYPE,