/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/importcontacts/WizardActivity.java

  • Committer: edam
  • Date: 2009-01-13 06:35:26 UTC
  • Revision ID: edam@waxworlds.org-20090113063526-l9t1s9git4bav60a
- new contact's phone numebrs and email addresses are added to the caches after those contacts are updated to account for the situation where the same contact is imported again from another file (or the contact exists twice in the same file!?)

Show diffs side-by-side

added added

removed removed

32
32
 
33
33
public class WizardActivity extends Activity
34
34
{
35
 
        private int _nextState;
36
 
        private boolean _backEnabled;
 
35
        private int _nextState = 0;
37
36
 
38
37
        @Override
39
38
        protected void onCreate(Bundle savedInstanceState)
40
39
        {
41
40
                super.onCreate(savedInstanceState);
42
41
 
43
 
                _nextState = 0;
44
 
 
45
 
                // deal with saved state vs. defaults
46
 
                if( savedInstanceState == null)
47
 
                {
48
 
                        _backEnabled = false;
49
 
 
50
 
                        Bundle extras = getIntent().getExtras();
51
 
                        if( extras != null )
52
 
                                _backEnabled = extras.getBoolean( "backstate" );
53
 
                }
54
 
                else
55
 
                {
56
 
                        _backEnabled = savedInstanceState.getBoolean( "_backEnabled" );
57
 
                }
58
 
 
59
 
                // enable/disable back button
60
 
                ( (Button)findViewById( R.id.back ) ).setEnabled( _backEnabled );
61
 
 
62
42
                // set up next button
63
43
                Button next = (Button)findViewById( R.id.next );
64
44
                next.setOnClickListener( new View.OnClickListener() {
65
45
                        public void onClick( View view ) {
66
 
                                onNext();
 
46
                                switchToState( _nextState );
67
47
                        }
68
48
                } );
69
49
 
75
55
                                finish();
76
56
                        }
77
57
                } );
78
 
        }
79
 
 
80
 
        @Override
81
 
        protected void onSaveInstanceState( Bundle outState ) {
82
 
                super.onSaveInstanceState(outState);
83
 
                outState.putBoolean( "_backEnabled", _backEnabled );
84
 
        }
85
 
/*
86
 
        @Override
87
 
        protected void onPause()
88
 
        {
89
 
                super.onPause();
90
 
        }
91
 
 
92
 
        @Override
93
 
        protected void onResume()
94
 
        {
95
 
                super.onResume();
96
 
        }
97
 
*/
98
 
        protected void onNext()
99
 
        {
100
 
                switchToState( _nextState );
 
58
 
 
59
                // enable back button?
 
60
                Bundle extras = getIntent().getExtras();
 
61
                if( extras != null ) {
 
62
                        Boolean backstate = extras.getBoolean( "backstate" );
 
63
                        if( backstate != null )
 
64
                                ( (Button)findViewById( R.id.back ) ).setEnabled( true );
 
65
                }
101
66
        }
102
67
 
103
68
        protected void setNextState( int nextState )