Button btnSave = (Button)findViewById(R.id.save);
btnSave.setOnClickListener(new Button.OnClickListener(){
public void onClick(View v){
SharedPreferences pref = getSharedPreferences("pref", Activity.MODE_PRIVATE);
EditText PhoneNum = (EditText)findViewById(R.id.phone);
EditText Address = (EditText)findViewById(R.id.address);
Customer.this.finish();
}
});
public void onStop(){ // 어플리케이션이 화면에서 사라질때
super.onStop();
SharedPreferences pref = getSharedPreferences("pref", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
EditText PhoneNum = (EditText)findViewById(R.id.phone);
EditText Address = (EditText)findViewById(R.id.address);
editor.commit(); // 저장합니다.
}
다이얼로그 액티비티를 하나 띄운 후에 저 버튼을 누르면 원래 있던 액티비티로 돌아가게 되는데
다시 이 액티비티를 불러올 때 이전에 EditText 에 있던 정보를 유지하고싶은데
아무런 반응이 없네요.....
무언가 더 추가해야 하는건가요? 아니면 쓰인 위치가 잘못된건가요?