How to save and view user input value of Alert Dialog's edit Text filed.
i already saved the value using shared preference but when Alert Dialog load for second time value is not appeared.

save the values using shared Preference

```
alertDialog1.setButton(AlertDialog.BUTTON_NEUTRAL, "SEND", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
      //  alertDialog1.dismiss();
            //formatted url
            String sendURL = agentName.getText().toString();
            String name = nameURl.concat(sendURL).concat(nameUR2);
            agentName.setText(name);
           // setURLNANME(name);

            SharedPreferences sharedPreferences;
            EditText nm;
            String NAME = "namekkey";
            String myPreferences = null;

            nm = findViewById(R.id.input_agentname);
            sharedPreferences = getSharedPreferences(myPreferences,Context.MODE_PRIVATE);

            if (sharedPreferences.contains(NAME)){
                nm.setText(sharedPreferences.getString(NAME,""));
            }

        }
    });

    alertDialog1.setButton(AlertDialog.BUTTON_NEGATIVE, "CANCEL", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            alertDialog1.dismiss();
        }
    });
    alertDialog1.show();
}

```

once user type name and send want view the value again and again when user view the alert dialog.