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

  • Committer: edam
  • Date: 2010-12-11 23:57:07 UTC
  • Revision ID: edam@waxworlds.org-20101211235707-czyw48tt3hcopuwf
- read vCard files in as raw bytes now and convert to string only tentatively to check for version no.s and property names and params
- ASCII is now (correctly) the default charset
- added conversion from 8-bit ASCII to UTF-8 (not used on 7-bit US-ASCII) which works on raw bytes, not chars
- unencode quoted-printable now works on raw bytes, not chars

Show diffs side-by-side

added added

removed removed

26
26
import android.app.Activity;
27
27
import android.content.Intent;
28
28
import android.content.SharedPreferences;
29
 
import android.content.res.Configuration;
30
29
import android.os.Bundle;
31
30
import android.view.View;
32
31
import android.widget.Button;
33
32
 
34
33
public class WizardActivity extends Activity
35
34
{
36
 
        private Class< ? > _next_class;
 
35
        private Class< ? > _nextClass;
37
36
 
38
37
        @Override
39
 
        protected void onCreate( Bundle saved_instance_state )
 
38
        protected void onCreate( Bundle savedInstanceState )
40
39
        {
41
 
                super.onCreate( saved_instance_state );
 
40
                super.onCreate( savedInstanceState );
42
41
 
43
42
                // enable back button based on intent data
44
43
                Bundle extras = getIntent().getExtras();
63
62
        }
64
63
 
65
64
        @Override
66
 
        protected void onActivityResult( int request_code, int result_code,
67
 
                Intent data )
 
65
        protected void  onActivityResult( int requestCode, int resultCode, Intent data )
68
66
        {
69
 
                if( result_code == RESULT_OK ) {
 
67
                if( resultCode == RESULT_OK ) {
70
68
                        setResult( RESULT_OK );
71
69
                        finish();
72
70
                }
77
75
                // create bundle with back enabled state
78
76
                Bundle bundle = new Bundle();
79
77
                bundle.putBoolean( "back-enabled", true );
80
 
                Intent i = new Intent( this, _next_class );
 
78
                Intent i = new Intent( this, _nextClass );
81
79
                i.putExtras( bundle );
82
80
 
83
81
                // start next activity
92
90
 
93
91
        protected void setNextActivity( Class< ? > cls )
94
92
        {
95
 
                _next_class = cls;
 
93
                _nextClass = cls;
96
94
 
97
95
                // enable next button
98
96
                ( (Button)findViewById( R.id.next ) ).setEnabled( true );
102
100
        {
103
101
                return super.getSharedPreferences( "ImportContacts", 0 );
104
102
        }
105
 
 
106
 
        @Override
107
 
        public void onConfigurationChanged( Configuration new_config ) {
108
 
                super.onConfigurationChanged( new_config );
109
 
        }
110
103
}