以前做1.5版本的程序,没有这个问题,2.2的版本用同样的代码一直写不了,纳闷。。
想起看程序权限时,都有写入文件的权限,所以估计是需要明确的权限。
引用一些别人的问题:
You're right that the SD Card directory is /sdcard but you shouldn't be hard coding it. Instead, make a call to Environment.getExternalStorageDirectory() to get the directory:
If you haven't done so already, you will need to give you app the correct permission to write to the SD Card by adding this to your Manifest:
from: http://stackoverflow.com/questions/2121833/permission-to-write-to-the-sd-card
原创内容如转载请注明:来自 阿权的书房
想起看程序权限时,都有写入文件的权限,所以估计是需要明确的权限。
引用一些别人的问题:
You're right that the SD Card directory is /sdcard but you shouldn't be hard coding it. Instead, make a call to Environment.getExternalStorageDirectory() to get the directory:
File sdDir = Environment.getExternalStorageDirectory();
If you haven't done so already, you will need to give you app the correct permission to write to the SD Card by adding this to your Manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
from: http://stackoverflow.com/questions/2121833/permission-to-write-to-the-sd-card
原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
brass casting


2010/11/10 16:22
原来是权限惹得祸,谢谢博主提醒。
分页: 1/1
1
1
android处理屏幕旋转
提取索爱导出的备份dbk文件里的通讯录
