Code example for FileWriter

Methods: closeappend

0
 
				if (!logFile.exists()) {
					logFile.createNewFile();
				} 
 
				writer = new FileWriter(logFile, true);
 
				if (writer != null) {
					writer.append(message);
				} 
				// writer.flush(); 
				writer.close();
 
			} 
		} catch (IOException e) {
			Toast.makeText(c, "FILE NOT WRITTEN!! ", 5000);
		} 
 
	} 
 
Connect your IDE to all the code out there  Get Codota for Java