/android/import-contacts

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

« back to all changes in this revision

Viewing changes to src/org/waxworlds/edam/importcontacts/Doit.java

  • Committer: edam
  • Date: 2011-05-05 21:49:43 UTC
  • Revision ID: edam@waxworlds.org-20110505214943-bg0cn6qz0gr49dlk
- updated TODO
- made varibale names consistent (camelCaseVariables now_use_underscores)

Show diffs side-by-side

added added

removed removed

21
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
22
 */
23
23
 
24
 
package org.waxworlds.importcontacts;
 
24
package org.waxworlds.edam.importcontacts;
25
25
 
26
26
import android.app.AlertDialog;
27
27
import android.app.Dialog;
36
36
import android.widget.Button;
37
37
import android.widget.CheckBox;
38
38
import android.widget.CompoundButton;
39
 
import android.widget.LinearLayout;
40
39
import android.widget.ProgressBar;
41
40
import android.widget.TextView;
42
41
import android.widget.Toast;
47
46
        private final static int DIALOG_CONTINUEORABORT = 1;
48
47
        private final static int DIALOG_MERGEPROMPT = 2;
49
48
 
50
 
        public final static int MESSAGE_FINISHED_ALLDONE = 0;
51
 
        public final static int MESSAGE_FINISHED = 1;
52
 
        public final static int MESSAGE_FINISHED_GOBACK = 2;
 
49
        public final static int MESSAGE_ALLDONE = 0;
 
50
        public final static int MESSAGE_ABORT = 1;
53
51
        public final static int MESSAGE_ERROR = 3;
54
52
        public final static int MESSAGE_CONTINUEORABORT = 4;
55
53
        public final static int MESSAGE_SETPROGRESSMESSAGE = 5;
67
65
        public final static int ACTION_MERGE_MERGE = 2;
68
66
        public final static int ACTION_OVERWRITE = 3;
69
67
 
70
 
        private boolean _startedProgress;
71
 
        private int _maxProgress;
72
 
        private int _tmpProgress;
 
68
        public final static int NEXT_BEGIN = 0;
 
69
        public final static int NEXT_CLOSE = 1;
 
70
 
 
71
        private boolean _started_progress;
 
72
        private int _max_progress;
 
73
        private int _tmp_progress;
73
74
        private int _progress;
74
 
        protected String _dialogMessage;
75
 
        private Dialog _mergePromptDialog;
76
 
        private boolean _mergePromptAlwaysSelected;
 
75
        protected String _dialog_message;
 
76
        private Dialog _merge_prompt_dialog;
 
77
        private boolean _merge_prompt_always_selected;
 
78
        private int _next_action;
 
79
        private int _current_dialog_id;
77
80
 
78
 
        private int _countOverwrites;
79
 
        private int _countCreates;
80
 
        private int _countMerges;
81
 
        private int _countSkips;
 
81
        private int _count_overwrites;
 
82
        private int _count_creates;
 
83
        private int _count_merges;
 
84
        private int _count_skips;
82
85
 
83
86
        protected Importer _importer = null;
84
87
 
90
93
                public void handleMessage( Message msg ) {
91
94
                        switch( msg.what )
92
95
                        {
93
 
                        case MESSAGE_FINISHED_ALLDONE:
 
96
                        case MESSAGE_ALLDONE:
94
97
                                ( (TextView)findViewById( R.id.doit_alldone ) ).
95
 
                                                setVisibility( View.VISIBLE );
96
 
                                // fall through
97
 
                        case MESSAGE_FINISHED:
98
 
                                ( (LinearLayout)findViewById( R.id.doit_closedisplay ) ).
99
 
                                                setVisibility( View.VISIBLE );
 
98
                                        setVisibility( View.VISIBLE );
 
99
                                ( (Button)findViewById( R.id.back ) ).setEnabled( false );
 
100
                                updateNext( NEXT_CLOSE );
 
101
                                findViewById( R.id.doit_abort_disp ).setVisibility(
 
102
                                        View.GONE );
100
103
                                break;
101
 
                        case MESSAGE_FINISHED_GOBACK:
102
 
                                ( (Button)findViewById( R.id.back ) ).setEnabled( true );
 
104
                        case MESSAGE_ABORT:
 
105
                                manualAbort();
103
106
                                break;
104
107
                        case MESSAGE_ERROR:
105
 
                                Doit.this._dialogMessage = (String)msg.obj;
 
108
                                _dialog_message = (String)msg.obj;
106
109
                                showDialog( DIALOG_ERROR );
107
110
                                break;
108
111
                        case MESSAGE_CONTINUEORABORT:
109
 
                                Doit.this._dialogMessage = (String)msg.obj;
 
112
                                _dialog_message = (String)msg.obj;
110
113
                                showDialog( DIALOG_CONTINUEORABORT );
111
114
                                break;
112
115
                        case MESSAGE_SETPROGRESSMESSAGE:
113
116
                                ( (TextView)findViewById( R.id.doit_percentage ) ).
114
 
                                                setText( (String)msg.obj );
 
117
                                        setText( (String)msg.obj );
115
118
                                break;
116
119
                        case MESSAGE_SETMAXPROGRESS:
117
 
                                if( _maxProgress > 0 ) {
118
 
                                        if( _tmpProgress == _maxProgress )
119
 
                                                _tmpProgress = (Integer)msg.obj;
120
 
                                        if( _progress == _maxProgress )
 
120
                                if( _max_progress > 0 ) {
 
121
                                        if( _tmp_progress == _max_progress - 1 )
 
122
                                                _tmp_progress = (Integer)msg.obj;
 
123
                                        if( _progress == _max_progress - 1 )
121
124
                                                _progress = (Integer)msg.obj;
122
125
                                }
123
 
                                _maxProgress = (Integer)msg.obj;
 
126
                                _max_progress = (Integer)msg.obj;
124
127
                                updateProgress();
125
128
                                break;
126
129
                        case MESSAGE_SETTMPPROGRESS:
127
 
                                _tmpProgress = (Integer)msg.obj;
 
130
                                _tmp_progress = (Integer)msg.obj;
128
131
                                updateProgress();
129
132
                                break;
130
133
                        case MESSAGE_SETPROGRESS:
131
 
                                _startedProgress = true;
 
134
                                _started_progress = true;
132
135
                                _progress = (Integer)msg.obj;
133
136
                                updateProgress();
134
137
                                break;
135
138
                        case MESSAGE_MERGEPROMPT:
136
 
                                _dialogMessage = (String)msg.obj;
 
139
                                _dialog_message = (String)msg.obj;
137
140
                                showDialog( DIALOG_MERGEPROMPT );
138
141
                                break;
139
142
                        case MESSAGE_CONTACTOVERWRITTEN:
140
 
                                _countOverwrites++;
 
143
                                _count_overwrites++;
141
144
                                updateStats();
142
145
                                break;
143
146
                        case MESSAGE_CONTACTCREATED:
144
 
                                _countCreates++;
 
147
                                _count_creates++;
145
148
                                updateStats();
146
149
                                break;
147
150
                        case MESSAGE_CONTACTMERGED:
148
 
                                _countMerges++;
 
151
                                _count_merges++;
149
152
                                updateStats();
150
153
                                break;
151
154
                        case MESSAGE_CONTACTSKIPPED:
152
 
                                _countSkips++;
 
155
                                _count_skips++;
153
156
                                updateStats();
154
157
                                break;
155
158
                        default:
159
162
        }
160
163
 
161
164
        @Override
162
 
        protected void onCreate(Bundle savedInstanceState)
 
165
        protected void onCreate(Bundle saved_instance_state)
163
166
        {
164
167
                setContentView( R.layout.doit );
165
 
                super.onCreate( savedInstanceState );
 
168
                super.onCreate( saved_instance_state );
166
169
 
167
170
                // hide page 2
168
171
                ( findViewById( R.id.doit_page_2 ) ).setVisibility( View.GONE );
169
172
 
170
 
                // set up begin button
171
 
                Button begin = (Button)findViewById( R.id.doit_begin );
 
173
                // set up abort button
 
174
                Button begin = (Button)findViewById( R.id.abort );
172
175
                begin.setOnClickListener( new View.OnClickListener() {
173
176
                        public void onClick( View view ) {
174
 
                                importContacts();
175
 
                        }
176
 
                } );
177
 
 
178
 
                // set up close button
179
 
                Button close = (Button)findViewById( R.id.doit_close );
180
 
                close.setOnClickListener( new View.OnClickListener() {
181
 
                        public void onClick( View view ) {
182
 
                                setResult( RESULT_CANCELED );
183
 
                                finish();
184
 
                        }
185
 
                } );
186
 
 
187
 
                _startedProgress = false;
188
 
                _maxProgress = 0;
189
 
                _tmpProgress = 0;
 
177
                                manualAbort();
 
178
                        }
 
179
                } );
 
180
 
 
181
                _started_progress = false;
 
182
                _max_progress = 0;
 
183
                _tmp_progress = 0;
190
184
                _progress = 0;
191
185
                _handler = new DoitHandler();
192
186
 
193
 
                _countOverwrites = 0;
194
 
                _countCreates = 0;
195
 
                _countMerges = 0;
196
 
                _countSkips = 0;
 
187
                _count_overwrites = 0;
 
188
                _count_creates = 0;
 
189
                _count_merges = 0;
 
190
                _count_skips = 0;
 
191
 
 
192
                updateNext( NEXT_BEGIN );
197
193
 
198
194
                updateProgress();
199
195
                updateStats();
205
201
                super.onPause();
206
202
 
207
203
                // saving the state of an import sounds complicated! Lets just abort!
208
 
                abortImport();
209
 
 
210
 
                // destroy some stuff
211
 
                _importer = null;
212
 
                _handler = null;
 
204
                if( _next_action != NEXT_CLOSE )
 
205
                        manualAbort( true );
213
206
        }
214
207
 
215
208
        @Override
216
 
        protected Dialog onCreateDialog(int id)
 
209
        protected Dialog onCreateDialog( int id )
217
210
        {
218
211
                switch( id )
219
212
                {
220
213
                case DIALOG_ERROR:
221
214
                        return new AlertDialog.Builder( this )
222
 
                                        .setIcon( R.drawable.alert_dialog_icon )
223
 
                                        .setTitle( R.string.error_title )
224
 
                                        .setMessage( "" )
225
 
                                        .setPositiveButton( R.string.error_ok,
226
 
                                                        new DialogInterface.OnClickListener() {
227
 
                                                public void onClick(DialogInterface dialog,
228
 
                                                                int whichButton) {
 
215
                                .setIcon( R.drawable.alert_dialog_icon )
 
216
                                .setTitle( R.string.error_title )
 
217
                                .setMessage( "" )
 
218
                                .setPositiveButton( R.string.error_ok,
 
219
                                        new DialogInterface.OnClickListener() {
 
220
                                                public void onClick( DialogInterface dialog,
 
221
                                                        int whichButton )
 
222
                                                {
229
223
                                                        Doit.this._importer.wake();
230
224
                                                }
231
225
                                        } )
232
 
                                        .setOnCancelListener( _dialogOnCancelListener )
233
 
                                        .create();
 
226
                                .setOnCancelListener( _dialog_on_cancel_listener )
 
227
                                .create();
234
228
                case DIALOG_CONTINUEORABORT:
235
229
                        return new AlertDialog.Builder( this )
236
 
                                        .setIcon( R.drawable.alert_dialog_icon )
237
 
                                        .setTitle( R.string.error_title )
238
 
                                        .setMessage( "" )
239
 
                                        .setPositiveButton( R.string.error_continue,
240
 
                                                        new DialogInterface.OnClickListener() {
241
 
                                                public void onClick(DialogInterface dialog,
242
 
                                                                int whichButton) {
243
 
                                                        Doit.this._importer.wake(
244
 
                                                                        Importer.RESPONSE_POSITIVE );
245
 
                                                }
246
 
                                        } )
247
 
                                        .setNegativeButton( R.string.error_abort,
248
 
                                                        new DialogInterface.OnClickListener() {
249
 
                                                public void onClick(DialogInterface dialog,
250
 
                                                                int whichButton) {
251
 
                                                        Doit.this._importer.wake(
252
 
                                                                        Importer.RESPONSE_NEGATIVE );
253
 
                                                }
254
 
                                        } )
255
 
                                        .setOnCancelListener( _dialogOnCancelListener )
256
 
                                        .create();
 
230
                                .setIcon( R.drawable.alert_dialog_icon )
 
231
                                .setTitle( R.string.error_title )
 
232
                                .setMessage( "" )
 
233
                                .setPositiveButton( R.string.error_continue,
 
234
                                        new DialogInterface.OnClickListener() {
 
235
                                                public void onClick( DialogInterface dialog,
 
236
                                                        int which_button )
 
237
                                                {
 
238
                                                        Doit.this._importer.wake(
 
239
                                                                Importer.RESPONSE_POSITIVE );
 
240
                                                }
 
241
                                        } )
 
242
                                .setNegativeButton( R.string.error_abort,
 
243
                                        new DialogInterface.OnClickListener() {
 
244
                                                public void onClick( DialogInterface dialog,
 
245
                                                        int which_button )
 
246
                                                {
 
247
                                                        Doit.this._importer.wake(
 
248
                                                                Importer.RESPONSE_NEGATIVE );
 
249
                                                }
 
250
                                        } )
 
251
                                .setOnCancelListener( _dialog_on_cancel_listener )
 
252
                                .create();
257
253
                case DIALOG_MERGEPROMPT:
258
254
                        // custom layout in an AlertDialog
259
255
                        LayoutInflater factory = LayoutInflater.from( this );
260
 
                        final View dialogView = factory.inflate(
261
 
                                        R.layout.mergeprompt, null );
262
 
                        ( (CheckBox)dialogView.findViewById( R.id.mergeprompt_always ) ).
263
 
                                        setOnCheckedChangeListener(
264
 
                                                        new CompoundButton.OnCheckedChangeListener() {
265
 
                                public void onCheckedChanged( CompoundButton buttonView,
266
 
                                                boolean isChecked ) {
267
 
                                        Doit.this._mergePromptAlwaysSelected = isChecked;
268
 
                                }
269
 
                        } );
270
 
                        ( (Button)dialogView.findViewById( R.id.merge_keep ) ).
271
 
                                        setOnClickListener( _mergePromptButtonListener );
272
 
                        ( (Button)dialogView.findViewById( R.id.merge_overwrite ) ).
273
 
                                        setOnClickListener( _mergePromptButtonListener );
274
 
                        ( (Button)dialogView.findViewById( R.id.merge_merge ) ).
275
 
                                        setOnClickListener( _mergePromptButtonListener );
276
 
                        _mergePromptAlwaysSelected = false;
 
256
                        final View dialog_view = factory.inflate(
 
257
                                R.layout.mergeprompt, null );
 
258
                        ( (CheckBox)dialog_view.findViewById( R.id.mergeprompt_always ) ).
 
259
                                setOnCheckedChangeListener(
 
260
                                        new CompoundButton.OnCheckedChangeListener() {
 
261
                                                public void onCheckedChanged(
 
262
                                                        CompoundButton button_view, boolean is_checked )
 
263
                                                {
 
264
                                                        Doit.this._merge_prompt_always_selected =
 
265
                                                                is_checked;
 
266
                                                }
 
267
                                        } );
 
268
                        ( (Button)dialog_view.findViewById( R.id.merge_keep ) ).
 
269
                                setOnClickListener( _merge_prompt_button_listener );
 
270
                        ( (Button)dialog_view.findViewById( R.id.merge_overwrite ) ).
 
271
                                setOnClickListener( _merge_prompt_button_listener );
 
272
                        ( (Button)dialog_view.findViewById( R.id.merge_merge ) ).
 
273
                                setOnClickListener( _merge_prompt_button_listener );
 
274
                        ( (Button)dialog_view.findViewById( R.id.abort ) ).
 
275
                                setOnClickListener( _merge_prompt_button_listener );
 
276
                        _merge_prompt_always_selected = false;
277
277
                        return new AlertDialog.Builder( this )
278
 
                                        .setIcon( R.drawable.alert_dialog_icon )
279
 
                                        .setTitle( R.string.mergeprompt_title )
280
 
                                        .setView( dialogView )
281
 
                                        .setOnCancelListener( _dialogOnCancelListener )
282
 
                                        .create();
 
278
                                .setIcon( R.drawable.alert_dialog_icon )
 
279
                                .setTitle( R.string.mergeprompt_title )
 
280
                                .setView( dialog_view )
 
281
                                .setOnCancelListener( _dialog_on_cancel_listener )
 
282
                                .create();
283
283
                }
284
284
                return null;
285
285
        }
286
286
 
287
 
    private OnClickListener _mergePromptButtonListener = new OnClickListener() {
288
 
                public void onClick( View view ) {
289
 
                        int responseExtra = _mergePromptAlwaysSelected?
 
287
        private OnClickListener _merge_prompt_button_listener =
 
288
                new OnClickListener()
 
289
        {
 
290
                public void onClick( View view )
 
291
                {
 
292
                        // handle abort
 
293
                        if( view.getId() == R.id.abort )
 
294
                                manualAbort();
 
295
 
 
296
                        // else, response (just check we haven't aborted already!)
 
297
                        else if( Doit.this._importer != null ) {
 
298
                                int response_extra = _merge_prompt_always_selected?
290
299
                                        Importer.RESPONSEEXTRA_ALWAYS : Importer.RESPONSEEXTRA_NONE;
291
 
                        Doit.this._mergePromptDialog.dismiss();
292
 
                        Doit.this._mergePromptDialog = null;    // don't keep a reference!
293
 
                        Doit.this._importer.wake( convertIdToAction( view.getId() ),
294
 
                                        responseExtra );
 
300
                                Doit.this._importer.wake( convertIdToAction( view.getId() ),
 
301
                                        response_extra );
 
302
                        }
 
303
 
 
304
                        // close dialog and free (don't keep a reference)
 
305
                        Doit.this._merge_prompt_dialog.dismiss();
 
306
                        Doit.this._merge_prompt_dialog = null;
295
307
                }
296
308
        };
297
309
 
 
310
        @Override
 
311
        protected void onNext()
 
312
        {
 
313
                Button next = (Button)findViewById( R.id.next );
 
314
                next.setEnabled( false );
 
315
 
 
316
                switch( _next_action )
 
317
                {
 
318
                case NEXT_BEGIN:
 
319
                        importContacts();
 
320
                        break;
 
321
                case NEXT_CLOSE:
 
322
                        setResult( RESULT_OK );
 
323
                        finish();
 
324
                        break;
 
325
                }
 
326
        }
 
327
 
 
328
        private void manualAbort()
 
329
        {
 
330
                manualAbort( false );
 
331
        }
 
332
 
 
333
        private void manualAbort( boolean show_toaster_popup )
 
334
        {
 
335
                abortImport( show_toaster_popup );
 
336
 
 
337
                updateNext( NEXT_CLOSE );
 
338
                ( (Button)findViewById( R.id.back ) ).setEnabled( true );
 
339
                findViewById( R.id.doit_abort_disp ).setVisibility( View.GONE );
 
340
                ( (TextView)findViewById( R.id.doit_aborted ) ).
 
341
                        setVisibility( View.VISIBLE );
 
342
                ( (TextView)findViewById( R.id.doit_alldone ) ).
 
343
                        setVisibility( View.GONE );
 
344
 
 
345
                // close any open dialogs
 
346
                try {
 
347
                        dismissDialog( _current_dialog_id );
 
348
                }
 
349
                catch( Exception e ) {
 
350
                        // ignore errors
 
351
                }
 
352
        }
 
353
 
 
354
        private void updateNext( int next_action )
 
355
        {
 
356
                Button next = (Button)findViewById( R.id.next );
 
357
                switch( next_action ) {
 
358
                case NEXT_BEGIN:        next.setText( R.string.doit_begin ); break;
 
359
                case NEXT_CLOSE:        next.setText( R.string.doit_close ); break;
 
360
                }
 
361
                next.setEnabled( true );
 
362
                _next_action = next_action;
 
363
        }
 
364
 
298
365
        public static int convertIdToAction( int id ) {
299
366
                switch( id ) {
300
367
                case R.id.merge_keep:           return ACTION_KEEP;
313
380
                }
314
381
        }
315
382
 
316
 
        private DialogInterface.OnCancelListener _dialogOnCancelListener =
317
 
                        new DialogInterface.OnCancelListener() {
 
383
        private DialogInterface.OnCancelListener _dialog_on_cancel_listener =
 
384
                new DialogInterface.OnCancelListener()
 
385
        {
318
386
                public void onCancel( DialogInterface dialog ) {
319
 
                        setResult( RESULT_CANCELED );
320
 
                        finish();
 
387
                        manualAbort();
321
388
                }
322
389
        };
323
390
 
 
391
 
324
392
        @Override
325
 
        protected void onActivityResult( int requestCode, int resultCode,
326
 
                        Intent data )
 
393
        protected void onActivityResult( int request_code, int result_code,
 
394
                Intent data )
327
395
        {
328
396
                // if we're cancelling, abort any import
329
 
                if( resultCode == RESULT_CANCELED )
330
 
                        abortImport();
 
397
                if( result_code == RESULT_CANCELED )
 
398
                        abortImport( true );
331
399
        }
332
400
 
333
401
        @Override
334
 
        protected void onPrepareDialog(int id, Dialog dialog)
 
402
        protected void onPrepareDialog( int id, Dialog dialog )
335
403
        {
 
404
                _current_dialog_id = id;
 
405
 
336
406
                switch( id )
337
407
                {
338
408
                case DIALOG_ERROR:      // fall through
339
409
                case DIALOG_CONTINUEORABORT:
340
410
                        // set dialog message
341
 
                        ( (AlertDialog)dialog ).setMessage( _dialogMessage );
 
411
                        ( (AlertDialog)dialog ).setMessage( _dialog_message );
342
412
                        break;
343
413
                case DIALOG_MERGEPROMPT:
344
414
                        // set contact's name
345
 
                        ( (TextView)dialog.findViewById( R.id.mergeprompt_name ) ).setText(
346
 
                                        _dialogMessage );
 
415
                        ( (TextView)dialog.findViewById( R.id.mergeprompt_name ) )
 
416
                                .setText( _dialog_message );
347
417
                        // and set up reference to dialog
348
 
                        _mergePromptDialog = dialog;
 
418
                        _merge_prompt_dialog = dialog;
349
419
                        break;
350
420
                }
351
421
 
371
441
        private void updateProgress()
372
442
        {
373
443
                ProgressBar bar = (ProgressBar)findViewById( R.id.doit_progress );
374
 
                TextView outOf = (TextView)findViewById( R.id.doit_outof );
 
444
                TextView out_of = (TextView)findViewById( R.id.doit_outof );
375
445
 
376
 
                if( _maxProgress > 0 )
 
446
                if( _max_progress > 0 )
377
447
                {
378
 
                        bar.setMax( _maxProgress );
379
 
                        bar.setSecondaryProgress( _tmpProgress );
 
448
                        bar.setMax( _max_progress );
 
449
                        bar.setSecondaryProgress( _tmp_progress );
380
450
 
381
 
                        if( _startedProgress )
 
451
                        if( _started_progress )
382
452
                        {
383
453
                                ( (TextView)findViewById( R.id.doit_percentage ) ).setText(
384
 
                                                (int)Math.round( 100 * _progress / _maxProgress ) + "%" );
385
 
                                outOf.setText( _progress + "/" + _maxProgress );
 
454
                                        (int)Math.round( 100 * _progress / _max_progress ) + "%" );
 
455
                                out_of.setText( _progress + "/" + _max_progress );
386
456
                                bar.setProgress( _progress );
387
457
                        }
388
458
                }
391
461
        private void updateStats()
392
462
        {
393
463
                ( (TextView)findViewById( R.id.doit_overwrites ) ).setText(
394
 
                                "" + _countOverwrites );
 
464
                        "" + _count_overwrites );
395
465
                ( (TextView)findViewById( R.id.doit_creates ) ).setText(
396
 
                                "" + _countCreates );
 
466
                        "" + _count_creates );
397
467
                ( (TextView)findViewById( R.id.doit_merges ) ).setText(
398
 
                                "" + _countMerges );
 
468
                        "" + _count_merges );
399
469
                ( (TextView)findViewById( R.id.doit_skips ) ).setText(
400
 
                                "" + _countSkips );
 
470
                        "" + _count_skips );
401
471
        }
402
472
 
403
 
        private void abortImport()
 
473
        private void abortImport( boolean show_toaster_popup )
404
474
        {
405
475
                if( _importer != null )
406
476
                {
417
487
                                }
418
488
 
419
489
                                // notify the user
420
 
                        Toast.makeText( this, R.string.doit_importaborted,
421
 
                                        Toast.LENGTH_LONG ).show();
 
490
                                if( show_toaster_popup )
 
491
                                        Toast.makeText( this, R.string.doit_importaborted,
 
492
                                                Toast.LENGTH_LONG ).show();
422
493
                        }
423
494
                }
 
495
 
 
496
                // destroy some stuff
 
497
                _importer = null;
 
498
                _handler = null;
424
499
        }
425
500
}