Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.androidexplorer;
- import java.io.File;
- import android.os.Environment;
- import android.util.Log;
- public class Newfolder {
- public static boolean createDirIfNotExists(String path) {
- boolean ret = true;
- File file = new File(Environment.getExternalStorageDirectory(), path);
- if (!file.exists()) {
- if (!file.mkdirs()) {
- Log.e("TravellerLog :: ", "Problem creating Image folder");
- ret = false;
- }
- }
- return ret;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement