Your chunk of code does not create a new one, it only checks if its already there and nothing else.
File file = new File(filePath);
if(file.exists())
//Do something
else
// Do something else.
More Related Contents:
- Trying to create a file in Android: open failed: EROFS (Read-only file system)
- Android saving file to external storage
- onActivityResult’s intent.getPath() doesn’t give me the correct filename
- Android file chooser [closed]
- How to read file from res/raw by name
- Convert file: Uri to File in Android
- How to programmatically move, copy and delete files and directories on SD?
- How do I serialize an object and save it to a file in Android?
- Android: Getting a file URI from a content URI?
- How to create text file and insert data to that file on Android
- Creating temporary files in Android
- Creating a directory in /sdcard fails
- Pick any kind of file via an Intent in Android
- Android path to asset txt file
- Can’t get file uri from intent onActivityResult
- simple HttpURLConnection POST file multipart/form-data from android to google blobstore
- Unzip a zipped file on sd card in Android application
- Register to be default app for custom file type
- Sending a File using Bluetooth OBEX Object Push Profile (OPP)
- How to include data files with the app’s APK?
- Writing/Reading Files to/from Android phone’s internal memory
- How to create/write file in the root of the Android device?
- Delete file from internal storage
- Android open pdf file
- Creating a pdf file in android programmatically and writing in it
- Android: Save file permanently (even after clear data / uninstall)
- How to zip and unzip the files?
- Android: how do I create File object from asset file?
- How to get the internal and external sdcard path in android
- Android append text file