Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;

import java.io.File;

public class Main {

    public static File getFilesDir(Context context) {
        File result = context.getFilesDir();
        if (result == null) {
            result = context.getDir("files", 0);
        }
        if (result == null) {
            result = new File("/data/data/" + context.getPackageName() + "/app_files");
        }
        if (!result.exists()) {
            result.mkdirs();
        }
        return result;
    }
}