32
32
public class ImportContacts extends Activity
34
34
public static final int STATE_NONE = 0;
35
public static final int STATE_INTRO = 1;
36
public static final int STATE_CONFIGURE_VCF = 3;
37
public static final int STATE_MERGE = 4;
38
public static final int STATE_DOIT = 5;
35
public static final int STATE_IMPORT_VCF = 1;
36
public static final int STATE_MERGE = 2;
37
public static final int STATE_DOIT = 3;
40
39
private Stack< Integer > _stateStack;
42
41
/** Called when the activity is first created. */
44
public void onCreate( Bundle savedInstanceState )
43
public void onCreate(Bundle savedInstanceState)
46
45
super.onCreate(savedInstanceState);
48
47
_stateStack = new Stack< Integer >();
50
if( savedInstanceState == null )
52
startState( STATE_INTRO );
56
int[] stack = savedInstanceState.getIntArray( "_stateStack" );
57
for( int n = 0; n < stack.length; n++ )
58
_stateStack.push( stack[ n ] );
59
int lastState = _stateStack.pop();
60
startState( lastState );
49
startState( STATE_IMPORT_VCF );
65
protected void onSaveInstanceState(Bundle outState) {
66
super.onSaveInstanceState(outState);
67
int[] stack = new int[ _stateStack.size() ];
68
for( int n = 0; n < _stateStack.size(); n++ )
69
stack[ n ] = _stateStack.elementAt( n );
70
outState.putIntArray( "_stateStack", stack );
74
53
protected void onActivityResult(int requestCode, int resultCode, Intent data)
76
55
super.onActivityResult(requestCode, resultCode, data);
112
90
// figure out the class
114
92
switch( newState ) {
115
case STATE_INTRO: cls = Intro.class; break;
116
case STATE_CONFIGURE_VCF: cls = ConfigureVCF.class; break;
93
case STATE_IMPORT_VCF: cls = ImportVCF.class; break;
117
94
case STATE_MERGE: cls = Merge.class; break;
118
95
case STATE_DOIT: cls = Doit.class; break;