/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/VcardExporter.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

55
55
 
56
56
                // check if the output file already exists
57
57
                if( file.exists() && file.length() > 0 )
58
 
                        showContinue( R.string.error_vcf_exists );
 
58
                        if( !showContinue( R.string.error_vcf_exists ) )
 
59
                                finish( ACTION_ABORT );
59
60
 
60
61
                // open file
61
62
                try {
82
83
                        // length of the line we'll be pulling off
83
84
                        int len = 75;
84
85
 
 
86
                        // if splitting at this length would break apart a codepoint, use
 
87
                        // one less char
 
88
                        if( Character.isHighSurrogate( line.charAt( len - 1 ) ) )
 
89
                                len--;
 
90
 
85
91
                        // count how many backslashes would be at the end of the line we're
86
92
                        // pulling off
87
93
                        int count = 0;
170
176
                        return false;
171
177
 
172
178
                // append header
173
 
                out.append( "VCARD:BEGIN\n" );
 
179
                out.append( "BEGIN:VCARD\n" );
174
180
                out.append( "VERSION:3.0\n" );
175
181
 
176
182
                // append formatted name
270
276
                }
271
277
 
272
278
                // append footer
273
 
                out.append( "VCARD:END\n" );
 
279
                out.append( "END:VCARD\n" );
274
280
 
275
281
                // write to file
276
282
                try {