0

I'm currently making an Android app that will ask some questions and then put the results into a text file for processing in another application. As far as I can tell, everything is working except the text file part. I've done a bunch of looking online and haven't found an answer. Here is the relevant part of my code so far:

                try {
                    String test = "Test";
                    File myObj = new File("test.txt");
                    new FileWriter(myObj, Boolean.parseBoolean(test));
                } catch (Exception e) {
                    e.printStackTrace();
                }

I have this code set to go off when the button is pressed. I have confirmed the button works because I can replace the code above with System.exit(0) and it will exit the app. After I press the button I will search my tablet for text files but no text files were created. Is there something obvious I'm missing?

Thanks for any assistance provided.

  • 1
    Duplicate of [Saving Files in Android - For Beginners (Internal / External Storage)](https://stackoverflow.com/questions/51565897/saving-files-in-android-for-beginners-internal-external-storage) – Guy Incognito Jun 11 '20 at 17:52
  • There exist a youtube tutorials for that: https://www.youtube.com/watch?v=I1fLQxdxdk4 – Fareed Khan Jun 11 '20 at 17:57

0 Answers0