Created
January 15, 2020 21:45
-
-
Save parzibyte/08df8a94ab0a86c3ce4fbb960997a39c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Definir ruta del archivo | |
val nombreArchivo = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString() + "/" + "test.csv" | |
Toast.makeText(this, "Guardando en $nombreArchivo", Toast.LENGTH_SHORT).show() | |
val file = File(nombreArchivo) | |
if (!file.exists()) { | |
file.createNewFile() | |
} | |
val fileWriter = FileWriter(file) | |
val bufferedWriter = BufferedWriter(fileWriter) | |
bufferedWriter.write("Hola")// <-- Aquí el contenido | |
bufferedWriter.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment