first of all why are you using editText = (EditText) findViewById(R.id.editText1);
two times.
use only in onCreate()
and use this code
@Override
protected void onPause() {
SharedPreferences pref = getSharedPreferences("YOUR_KEY", MODE_PRIVATE);
Editor edit = pref.edit();
edit.putString("som.arshay.retreive.data", editText.getText().toString());
edit.commit();
super.onPause();
}
@Override
protected void onResume() {
SharedPreferences pref = getSharedPreferences("YOUR_KEY", MODE_PRIVATE);
String newValue = pref.getString("som.arshay.retreive.data", "");
editText.setText(newValue);
super.onResume();
}