我收到的错误是在这个特定的文件中
FileInputStream fstream = new FileInputStream("data/data/com.demo.filesave/AllData");
==>>07-27 10:41:30.710: java.io.FileNotFoundException: /data/data/com.demo.filesave/AllData (权限被拒绝)
==>>07-27 10:41:33.914: V/Log_tag(9274): java.io.FileNotFoundException: /data/data/com.demo.filesave/AllData/signature.png (权限被拒绝)
//File SignSave = Environment.getExternalStorageDirectory();
FileWrite(SignSave,"confirmation");
public void FileWrite(File aPath,String aBody)
{
try
{
//System.out.println("@@@@ Inside Try FileWrite @@@@");
Log.e("BEFORE FILE","BEFORE FILE");
aPath.createNewFile();
Log.e("AFTER FILE","BEFORE AFTER");
PrintWriter out1 = new PrintWriter(aPath);
Log.e("AFTER FILE","AFTER PRINT WRITER");
out1.write(aBody);
Log.e("AFTER FILE","AFTER WRITING");
//System.out.println (aBody.trim());
out1.flush();
out1.close();
}
catch (IOException ioe)
{
//System.out.println("@@@@ Inside Catch FileWrite @@@@");
ioe.printStackTrace();
}
}
==>>07-27 10:41:33.921: W/System.err(9274): at java.io.FileNotFoundException /mnt/sdcard (Is a directory) on line PrintWriter out1 = new PrintWriter(aPath);
清单文件中的权限
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
请帮助我解决问题。
问候,