/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-02-02 06:38:20 UTC
  • Revision ID: edam@waxworlds.org-20090202063820-a37ptsjcj8ipgodn
- renamed ImportVCF class to ConfigureVCF
- save/restore back button state
- trying to save/restore state in ImpoirtContacts, but it doesn't work

Show diffs side-by-side

added added

removed removed

32
32
 
33
33
public class WizardActivity extends Activity
34
34
{
35
 
        private int _nextState = 0;
 
35
        private int _nextState;
 
36
        private boolean _backEnabled;
36
37
 
37
38
        @Override
38
39
        protected void onCreate(Bundle savedInstanceState)
39
40
        {
40
41
                super.onCreate(savedInstanceState);
41
42
 
 
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
 
42
62
                // set up next button
43
63
                Button next = (Button)findViewById( R.id.next );
44
64
                next.setOnClickListener( new View.OnClickListener() {
55
75
                                finish();
56
76
                        }
57
77
                } );
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
 
                }
66
 
        }
67
 
 
 
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
*/
68
98
        protected void onNext()
69
99
        {
70
100
                switchToState( _nextState );