how to get saved text into edit text
<p>How could save the text as a text edit so that after leaving the activity and re-enter, It appear in the same edit text?</p>

<pre><code>    switchbutton.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            Switch sw = (Switch) v;

            if (sw.isChecked()) {
                SharedPreferences settings = getPreferences(0);
                SharedPreferences.Editor editor1 = settings.edit();
                editor1.putString("nombre", ed1.getText().toString());
                SharedPreferences.Editor editor2 = settings.edit();
                editor2.putString("apellido", ed2.getText().toString());
                SharedPreferences.Editor editor3 = settings.edit();
                editor3.putString("ciudad", ed3.getText().toString());
                SharedPreferences.Editor editor4 = settings.edit();
                editor4.putString("calle", ed4.getText().toString());
                SharedPreferences.Editor editor5 = settings.edit();
                editor5.putString("numero", ed5.getText().toString());
                editor1.commit();
                editor2.commit();
                editor3.commit();
                editor4.commit();
                editor5.commit();   
            } else {

                Toast.makeText(OtraActivity.this, "Datos no guardados",
                        Toast.LENGTH_LONG).show();
            }
        }});
</code></pre>
