title: Add extension to a manually imputted filename
body: <p>After so many attempts, I've failed to set a user input name to a file and automatically put an extension at the end. So in my case I have a simple .txt, I'm trying to save my file using onClickListener. </p>
  
  <p>Normally it would work like:</p>
  
  <pre><code>public void onClick(View view) {                
              try {
                  FileOutputStream fout =
                      openFileOutput("filename_here.txt" , MODE_WORLD_READABLE);
  </code></pre>
  
  <p>But I'd like to let the user set a personal title here, so I've this in my Activity:</p>
  
  <pre><code>        save.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Message = maintext.getText().toString();
              try {
                  FileOutputStream fout = openFileOutput(title.getText().toString()+".txt" , MODE_WORLD_READABLE); //look at the extension .txt
                  OutputStreamWriter outsw = new OutputStreamWriter(fout);
                  try {
                      outsw.write(Message);
                      outsw.flush();
                      outsw.close();
                      Toast.makeText(getBaseContext(), "Your file has been saved", Toast.LENGTH_LONG).show();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              } catch (FileNotFoundException e) {
                  e.printStackTrace();
              }
          }
      });
  </code></pre>
  
  <p>I don't know if this way to add an extension is possible but whenever I hit the save button my app crash!</p>