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.os.Environment;

public class Main {
    public static String RenameFileToNewPath(String oldpath) {
        String path = oldpath;
        path = path.replace("/mnt/sdcard/", "");
        String new_path = path.replace(".ck", "");
        File sdcard = Environment.getExternalStorageDirectory();
        File from = new File(sdcard, oldpath);
        File to = new File(sdcard, new_path);
        from.renameTo(to);
        return to.toString();
    }
}