/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/org/waxworlds/edam/exportcontacts/ContactsContactAccessor.java

  • Committer: edam
  • Date: 2012-04-24 11:17:41 UTC
  • Revision ID: tim@ed.am-20120424111741-gbzn6qr4i574d9s4
renamed contact readers to accessors

Show diffs side-by-side

added added

removed removed

1
1
/*
2
 
 * ContactsContactReader.java
 
2
 * ContactsContactAccessor.java
3
3
 *
4
 
 * Copyright (C) 2010 Tim Marston <edam@waxworlds.org>
 
4
 * Copyright (C) 2011 Tim Marston <edam@waxworlds.org>
5
5
 *
6
6
 * This file is part of the Export Contacts program (hereafter referred
7
7
 * to as "this program"). For more information, see
27
27
import android.database.Cursor;
28
28
import android.provider.Contacts;
29
29
 
30
 
public class ContactsContactReader implements ContactReader
 
30
public class ContactsContactAccessor implements ContactAccessor
31
31
{
32
32
        Activity _activity = null;
33
33
        Exporter _exporter = null;
34
34
        Cursor _cur = null;
35
35
 
36
 
        public ContactsContactReader( Activity activity, Exporter exporter )
 
36
        public ContactsContactAccessor( Activity activity, Exporter exporter )
37
37
        {
38
38
                _activity = activity;
39
39
                _exporter = exporter;
92
92
                                        Contacts.Organizations.COMPANY ) ),
93
93
                                cur.getString( cur.getColumnIndex(
94
94
                                        Contacts.Organizations.TITLE ) ) ) );
 
95
                cur.close();
95
96
 
96
97
                // get the phone numbers
97
98
                cur = _activity.managedQuery( Contacts.Phones.CONTENT_URI,
108
109
                                        Contacts.Phones.TYPE ) ),
109
110
                                cur.getString( cur.getColumnIndex(
110
111
                                        Contacts.Phones.NUMBER ) ) ) );
 
112
                cur.close();
111
113
 
112
114
                // get the email and postal addresses
113
115
                cur = _activity.managedQuery( Contacts.ContactMethods.CONTENT_URI,
141
143
                                        cur.getString( cur.getColumnIndex(
142
144
                                                Contacts.ContactMethods.DATA ) ) ) );
143
145
                }
 
146
                cur.close();
144
147
 
145
148
                return true;
146
149
        }