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

  • Committer: edam
  • Date: 2009-01-10 16:14:11 UTC
  • Revision ID: edam@waxworlds.org-20090110161411-4d17l9hs9d6j277q
Initial import

Show diffs side-by-side

added added

removed removed

 
1
package org.waxworlds.importcontacts;
 
2
 
 
3
import android.content.SharedPreferences;
 
4
import android.os.Bundle;
 
5
import android.widget.EditText;
 
6
 
 
7
public class ImportVCF extends WizardActivity
 
8
{
 
9
        @Override
 
10
        protected void onCreate( Bundle savedInstanceState )
 
11
        {
 
12
                setContentView( R.layout.import_vcf );
 
13
                super.onCreate( savedInstanceState );
 
14
 
 
15
                setNextState( ImportContacts.STATE_MERGE );
 
16
        }
 
17
 
 
18
        @Override
 
19
        protected void onPause() {
 
20
                super.onPause();
 
21
 
 
22
                SharedPreferences.Editor editor = getSharedPreferences().edit();
 
23
 
 
24
                // location
 
25
                EditText location = (EditText)findViewById( R.id.location );
 
26
                editor.putString( "location", location.getText().toString() );
 
27
 
 
28
                editor.commit();
 
29
        }
 
30
 
 
31
        @Override
 
32
        protected void onResume() {
 
33
                super.onResume();
 
34
 
 
35
                SharedPreferences prefs = getSharedPreferences();
 
36
 
 
37
                // location
 
38
                EditText location = (EditText)findViewById( R.id.location );
 
39
                location.setText( prefs.getString( "location", "/sdcard/contacts" ) );
 
40
        }
 
41
}