Just print an empty string into the file:
PrintWriter writer = new PrintWriter(file);
writer.print("");
writer.close();
More Related Contents:
- Reference variables in java [closed]
- Can't find the way to move an image (or others clickable objects)
- Why is my app is crashing while using async task?
- Firebase Android ListView not being displayed
- How to make an Android device vibrate? with different frequency?
- Get driving directions using Google Maps API v2
- How to WhiteList app in Doze mode Android 6.0
- How do I make an http request using cookies on Android?
- How to make a copy of a file in android?
- Android M Permissions: onRequestPermissionsResult() not being called
- Prevent Android activity dialog from closing on outside touch
- java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
- Garbage collector in Android
- Android resource not found exception?
- How to blur background images in Android
- How can I show ellipses on my TextView if it is greater than the 1 line?
- How to programmatically add views and constraints to a ConstraintLayout?
- How to move marker along polyline using google map
- MultiDex NoClassDefFound error
- How do I get difference between two dates in android?, tried every thing and post
- How can I pass values between a Dialog and an Activity?
- Proguard and reflection in Android
- How to Get JSON Array Within JSON Object?
- How to listen for Firebase setValue completion
- org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:transformClassesWithDexForDebug’
- How to set a custom font to the title in toolbar android
- How to check programmatically whether app is running in debug mode or not?
- Reading data from bluetooth device in android
- Android color picker to be included in the activity
- Encrypt with Node.js Crypto module and decrypt with Java (in Android app)