/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: 2010-07-04 14:44:48 UTC
  • Revision ID: edam@waxworlds.org-20100704144448-1m30v811opup20fs
- got rid of the pretend ImportContacts activity alltogether (and made the Intro activity the startup one)
- massively simplified the WizzardActivity class so it works propperly
- moved all code to org.waxworlds.edam
- added an "aborted" message when the importion is aborted
- simplified the 3 actions the worker thread can take when stopping (only 2 were actualy used) to "aborted" or "alldone"
- changed intro message to match website
- bugfix: don't blow up when the My Contacts group is missing

Show diffs side-by-side

added added

removed removed

200
200
        {
201
201
                super.onPause();
202
202
 
 
203
                // close any open dialogs
 
204
                try {
 
205
                        dismissDialog( _currentDialogId );
 
206
                }
 
207
                catch( Exception e ) {
 
208
                }
 
209
 
203
210
                // saving the state of an import sounds complicated! Lets just abort!
204
 
                if( _nextAction != NEXT_CLOSE )
205
 
                        manualAbort( true );
 
211
                manualAbort( true );
206
212
        }
207
213
 
208
214
        @Override
290
296
                        if( view.getId() == R.id.abort )
291
297
                                manualAbort();
292
298
 
293
 
                        // else, response (just check we haven't aborted already!)
294
 
                        else if( Doit.this._importer != null ) {
 
299
                        // else, response
 
300
                        else {
295
301
                                int responseExtra = _mergePromptAlwaysSelected?
296
302
                                                Importer.RESPONSEEXTRA_ALWAYS : Importer.RESPONSEEXTRA_NONE;
297
303
                                Doit.this._importer.wake( convertIdToAction( view.getId() ),
338
344
                        setVisibility( View.VISIBLE );
339
345
                ( (TextView)findViewById( R.id.doit_alldone ) ).
340
346
                        setVisibility( View.GONE );
341
 
 
342
 
                // close any open dialogs
343
 
                try {
344
 
                        dismissDialog( _currentDialogId );
345
 
                }
346
 
                catch( Exception e ) {
347
 
                }
348
347
        }
349
348
 
350
349
        private void updateNext( int nextAction )
379
378
        private DialogInterface.OnCancelListener _dialogOnCancelListener =
380
379
                        new DialogInterface.OnCancelListener() {
381
380
                public void onCancel( DialogInterface dialog ) {
382
 
                        manualAbort();
 
381
                        setResult( RESULT_CANCELED );
 
382
                        finish();
383
383
                }
384
384
        };
385
385
 
386
 
 
387
386
        @Override
388
387
        protected void onActivityResult( int requestCode, int resultCode,
389
388
                        Intent data )