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.