Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7745695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:05:12+00:00 2026-06-01T10:05:12+00:00

I got a little problem, it seems simple (personally I think it is), but

  • 0

I got a little problem, it seems simple (personally I think it is), but I couldn’t find a answer. But atleast I don’t know how to fix it.

I write some lines to a .txt file when I hit the button Save.
Then after that, when I type something else, and hit Save again, it overwrites my first lines.

But I want that it writes at a new line. Also when I close and restart the app again, and hit save again, it must save the text on a new line again.

So basically: How can I write text to a .txt file, without overwriting previous lines.
I can write to a file, so that is not the problem, but only how to NOT overwrite.

This is the “little” part of my code:

   public void Data_save_contacts(View v) {

        Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);

        try {

                writer_contact = new BufferedWriter(new FileWriter(root + "/Save/Contacten.txt"));
                writer_contact.write("Perceel "+str_boer_teler_nummer+" = "+str_boer_teler);
                writer_contact.newLine();   

        } catch (IOException e) {
            System.err.println(e);
        }
}

Please put me in the good directions.

Thanks already, Bigflow

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:05:14+00:00Added an answer on June 1, 2026 at 10:05 am

    You have to do

    writer_contact = new BufferedWriter(new FileWriter(root + “/Save/Contacten.txt”,true));

    Just as said in java documentation:

    FileWriter
    
    public FileWriter(File file,
                  boolean append)
           throws IOException
    
    Constructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
    
    Parameters:
    file - a File object to write to
    append - if true, then bytes will be written to the end of the file rather than the beginning 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a little problem, what I think, can't be hard. but somehow, I
I've created a simple class and got a little problem: I just want to
I got a little problem and nothing I test seems to work. My HTML:
Ok, I got a little problem with git. Seems by accidentally, I delete one
I've got quite typical problem, I think. I know there were similar topics here
i`ve got a little problem with LINQ. I read out some information via XML-RPC.
I got a little problem. Sometimes, when I try to call the following code,
I got a little problem, I got a code, that reads all pixels and
I've got a little problem using WPF Dispatcher Timer. On each timer tick my
i've got a little Problem regarding the AIF-Service in Dynamics Ax when sending a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.