how to rename filename in sdcard with android application?

Posted by Addy on Stack Overflow See other posts from Stack Overflow or by Addy
Published on 2010-05-24T11:52:24Z Indexed on 2010/05/24 12:11 UTC
Read the original article Hit count: 319

Filed under:
|
|
|
|

In my Android application, I want to rename the file name at runtime. How can I do it?

This is my code:

String[] command = {" mv", "sun moon.jpg"," sun_moon,jpg"};
try
{
    Process process = Runtime.getRuntime().exec(command);
} 
catch (IOException e)
{
    Toast.makeText(this, ""+e, Toast.LENGTH_LONG).show();
}

I also used renameTo(File f) method but its also not working..

© Stack Overflow or respective owner

Related posts about android

Related posts about runtime