title: Cannot change predefined String value
body: <p>I am building an audio recorder app. To store created audio files i create them using this String to name them</p>
  
  <pre><code>`public String inputName = "recorded_audio";`
  </code></pre>
  
  <p>this is the defult audio clip name unless the user types an other one by using <code>nameBtn</code></p>
  
  <p>Later i use an other String for the final name of the file</p>
  
  <pre><code>`mediaFileName += "/Files/Recordings/" + inputName + ".mp3";`
  </code></pre>
  
  <p>I want to give the user the option to name their files instead of having that "recorded_audio.mp3" so i added a button that pops up a dialogue for the user to insert a value. When pressed ok, the String <code>inputName</code> should have its value replaced by the user's input, so the next time a recording happens, the file will be saved with the user's input as a name. The problem: No matter what user inputs the files are always saved with the initial value of the String, as if the user never inputted a value.</p>
  
  <pre><code>public String inputName = "recorded_audio";
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.audio_recorder);
  
      recordBtn = findViewById(R.id.recordBtn);
      nameBtn = findViewById(R.id.nameBtn);
  </code></pre>
  
  <p>The dialog pop-up:</p>
  
  <pre><code>    nameBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              View view = (LayoutInflater.from(AudioRecorder.this)).inflate(R.layout.audio_name_input, null);
  
              AlertDialog.Builder alertBuilder = new AlertDialog.Builder(AudioRecorder.this);
              alertBuilder.setView(view);
              final EditText userInput = view.findViewById(R.id.userInput);
  
              alertBuilder.setCancelable(true).setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      inputName = String.valueOf(userInput.getText());
                  }
  
              });
  
              Dialog dialog = alertBuilder.create();
              dialog.show();
          }
      });
  </code></pre>
  
  <p>Saving the file:</p>
  
  <pre><code>    String folder_main = "Files/Recordings"; //Creates folder path
      File file = new File(Environment.getExternalStorageDirectory(), folder_main);
      file.mkdirs();
      mediaFileName = Environment.getExternalStorageDirectory().getAbsolutePath();
      mediaFileName += "/Files/Recordings/" + inputName + ".mp3";
  </code></pre>
  
  <p>Record Button:</p>
  
  <pre><code>    recordBtn.setOnTouchListener(new View.OnTouchListener() {
                  switch (motionEvent.getAction()) {
  
                      //User stops touching the button
                      case MotionEvent.ACTION_UP:
                          if (isRecording) {
                              stopRecording();
  
                              File file = new File(mediaFileName);
                              int file_size = Integer.parseInt(String.valueOf(file.length()));
                              if(file_size &gt;= 4096) {
                                  finish(); //Finishes activity.
                                  startActivity(getIntent()); //Restarts activity in order to reset chronometer
                                  startActivity(new Intent(AudioRecorder.this, AudioPlayer.class)); //Once recording is complete loads AudioPlayer activity
                              }
                              isRecording = false;
                          }
                          break;
  
                      //User touches the button
                      case MotionEvent.ACTION_DOWN:
                          //Recording Proccess
                          isRecording = true;
                          }
                          break;
  
                  }
                  return false;
              }
  </code></pre>