小编Dir*_*tad的帖子

软按钮栏的尺寸

有没有办法确定没有硬菜单按钮的设备菜单栏的尺寸(宽度)?(像archos设备).

我需要知道屏幕的可用尺寸......

android

9
推荐指数
2
解决办法
1万
查看次数

重命名SD卡中的文件夹

据说这应该是一项非常简单的任务,但我已经有一段时间没有成功......

在我的应用程序中,我在SD卡中创建了一个文件夹,我存储了临时的jpg文件.由于我不希望我的应用程序在浏览手机图像时显示这些临时文件,因此我试图隐藏该文件夹.所以,在创建dir后,我尝试重命名它,如下所示:

String tmppath="/sdcard/myapp/tmp";
try
{
//this creates a directory named TMP -->OK!
 File f=new File(tmppath); 
  if(!f.isDirectory())  
   f.mkdirs();  

//this was supposed to rename the directory to .TMP, but isn't working...

Process process=Runtime.getRuntime().exec("mv "+tmppath +" /sdcard/myapp/.tmp/");
process.waitFor();
}
catch(SecurityException e)
{
}
catch(IOException e)
{
} 
catch (InterruptedException e) 
{
}
Run Code Online (Sandbox Code Playgroud)

有什么想法吗?

directory android rename

4
推荐指数
2
解决办法
9143
查看次数

标签 统计

android ×2

directory ×1

rename ×1