bzr branch
http://bzr.ed.am/android/import-contacts
1
by edam
Initial import |
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 |
} |