I have a project with an open dialog box with an inflate giving the user the option to type a text to change the value of a String.
I'm having trouble closing this box and going back to the previous layout.
public class Calendario extends Activity {
AlertDialog.Builder alert = new AlertDialog.Builder(Calendario.this);
String Txt = "Digite sua mensagem";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.calendario );
Txtmessage = (TextView) findViewById( R.id.EdtMensagemCalendar );
Txtmessage.setText( Txt );
Txtmessage.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
View v1 = getLayoutInflater().inflate(R.layout.edit, null);
alert.setView(v1);
alert.create();
Edt = (EditText) findViewById( R.id.EdtM );
alert.show();
}
} );
The project loads the edit layout into the dialog box correctly, but I need it after the user types the requested message to close the dialog box by returning to the previous layout and supplying a new value to EditText.