title: How can I change the textView of an Activity from a DialogFragment?
body: <p>This is the java file of the activity</p>
  
  <pre><code>private TextView tv;
  
   private Button btn;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_menu_agente);
          tv = (TextView) findViewById(R.id.Estado);
      }
  
      //Método para el bottón rojo
  
      protected void BotonRojo(View view){
          DialogFragment dialogFragment = new DialogoOcupado();
          dialogFragment.show(getSupportFragmentManager(),"Un Dialogo");
      }
  
  
  Thats the DialogFragment class(extends DialogFragment)
  
  
      @NonNull
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  
          builder.setTitle("Aviso")
                  .setMessage("Vas a pasar a estado Ocupado, estás seguro?")
                  .setPositiveButton("Aceptar", new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialogInterface, int i) {
  
                              }
                          }
                  )
                  .setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialogInterface, int i) {
  
                      }
                  })
                  .setNeutralButton("Más Tarde", new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialogInterface, int i) {
  
                      }
                  });
  
          return builder.create();
      }
  </code></pre>
  
  <p>I want to change the <code>TextView(tv)</code> when the user press the button "Aceptar". How can I do it? I'm learning programming Android sorry.</p>