title: Saving using File output stream from Edittext in only one file
body: <p>kindly i need to save from edit text to a file or list using file output stream, however each time I save with name written in the edit text a new file is created, how can I make an only one file and each time I enter data in the edit text it updates the same file only.</p>
  
  <p>Also how can I add counters to the file</p>
  
  <pre><code>Button save;
  EditText Username, ID;
  String FILENAME, JOUR;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.internal);
      save = (Button) findViewById(R.id.button1);
      save.setOnClickListener(this);
      Username = (EditText) findViewById(R.id.editText1);
      ID = (EditText) findViewById(R.id.editText2);
  
  }
  
  
  
  @Override
  public void onClick(View arg0) {
      // TODO Auto-generated method stub
      FILENAME = Username.getText().toString();
      if (FILENAME.contentEquals("")){
          finish();
      }
      JOUR = ID.getText().toString();
  
      Username.setText("");
      ID.setText("");
  
      try {
          FileOutputStream fos = openFileOutput(FILENAME , Context.MODE_PRIVATE);
          fos.write(JOUR.getBytes());
      //  fos.write(FILENAME.getBytes());
          fos.close();
  
           Toast.makeText(
                     InternalStore.this,
                     FILENAME + " saved",
                     Toast.LENGTH_LONG).show();
  
      } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>}</p>