Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;
import android.content.Context;

public class Main {

    private static String getFileDir(Context context, String dirName) {
        File file = context.getFilesDir();
        if (null != file) {
            File temp = new File(file.getPath() + "/" + dirName);
            if (!temp.exists()) {
                temp.mkdirs();
            }
            return temp.getPath();
        }
        return null;
    }
}