/android/export-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/export-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/exportcontacts/ConfigureVCF.java

  • Committer: Tim Marston
  • Date: 2014-03-01 18:07:36 UTC
  • Revision ID: tim@ed.am-20140301180736-ow8n7rsmbcboabgf
removed hard-coded path to sdcard

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
        private FileChooser _file_chooser = null;
44
44
 
 
45
        // the sdcard path prefix
 
46
        private String _sdcard_prefix;
 
47
 
45
48
        // the save path
46
49
        private String _path;
47
50
 
54
57
                setNextActivity( Doit.class );
55
58
 
56
59
                // get sdcard prefix
57
 
                String sdcard_prefix = getSdCardPathPrefix();
58
 
                if( sdcard_prefix == null )
 
60
                _sdcard_prefix = getSdCardPathPrefix();
 
61
                if( _sdcard_prefix == null )
59
62
                        showDialog( DIALOG_NOSDCARD );
60
63
 
61
64
                // create file chooser
73
76
                                        }
74
77
                                }
75
78
                        } );
76
 
                _file_chooser.setPathPrefix( "/sdcard" );
 
79
                if( _sdcard_prefix != null )
 
80
                        _file_chooser.setPathPrefix( _sdcard_prefix );
77
81
 
 
82
                // set up browser button
78
83
                Button path_button = (Button)findViewById( R.id.path );
79
84
                path_button.setOnClickListener( new View.OnClickListener() {
80
85
                        public void onClick( View view ) {
90
95
                SharedPreferences.Editor editor = getSharedPreferences().edit();
91
96
 
92
97
                // path and filename
93
 
                editor.putString(  "path", _path );
 
98
                editor.putString( "path", _path );
94
99
                EditText filename = (EditText)findViewById( R.id.filename );
95
100
                editor.putString( "filename", filename.getText().toString() );
96
101
 
148
153
        protected void updatePathButton()
149
154
        {
150
155
                Button path_button = (Button)findViewById( R.id.path );
151
 
                path_button.setText(
152
 
                        _file_chooser.prettyPrint( "/sdcard" + _path, true ) );
 
156
                if( _sdcard_prefix != null )
 
157
                        path_button.setText(
 
158
                                _file_chooser.prettyPrint( _sdcard_prefix + _path, true ) );
153
159
        }
154
160
 
155
161
        protected void onBrowse()